Skip to content

Commit e9b4f70

Browse files
committed
Failed test.
1 parent cfff397 commit e9b4f70

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,4 +591,22 @@ class MetastoreDataSourcesSuite extends QueryTest with BeforeAndAfterEach {
591591
setConf(SQLConf.PARQUET_USE_DATA_SOURCE_API, originalUseDataSource)
592592
}
593593
}
594+
595+
test("SPARK-6024 wide schema support") {
596+
val schema = StructType((1 to 1000).map(i => StructField(s"c_${i}", StringType, true)))
597+
assert(
598+
schema.json.size > conf.schemaStringLengthThreshold,
599+
"To correctly test the fix of SPARK-6024, the value of " +
600+
s"spark.sql.sources.schemaStringLengthThreshold needs to be less than ${schema.json.size}")
601+
// Manually create a metastore data source table.
602+
catalog.createDataSourceTable(
603+
tableName = "wide_schema",
604+
userSpecifiedSchema = Some(schema),
605+
provider = "json",
606+
options = Map("path" -> "just a dummy path"),
607+
isExternal = false)
608+
609+
val actualSchema = table("wide_schema").schema
610+
assert(schema === actualSchema)
611+
}
594612
}

0 commit comments

Comments
 (0)