Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
private[spark] def convertMetastoreParquet: Boolean =
getConf("spark.sql.hive.convertMetastoreParquet", "true") == "true"

private[spark] def parquetBinaryAsString = setConf("spark.sql.parquet.binaryAsString", "false")

// Hive use parquet with older version, which do not differentiate between binary data and strings
// So here set spark.sql.parquet.binaryAsString to true
parquetBinaryAsString

override protected[sql] def executePlan(plan: LogicalPlan): this.QueryExecution =
new this.QueryExecution { val logical = plan }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ class HiveParquetSuite extends FunSuite with BeforeAndAfterAll with BeforeAndAft
compareRDDs(rddOrig, rddCopy, "testsource", ParquetTestData.testSchemaFieldNames)
}

test("SPARK-4553: String issue for Parquet Table") {
sql("CREATE TABLE parquet_string(key INT, value STRING)")
sql("INSERT OVERWRITE TABLE parquet_string SELECT * FROM src")
sql("SELECT * FROM parquet_string").collect.foreach(println)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this

}

private def compareRDDs(rddOne: Array[Row], rddTwo: Array[Row], tableName: String, fieldNames: Seq[String]) {
var counter = 0
(rddOne, rddTwo).zipped.foreach {
Expand Down