File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1432,13 +1432,11 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
14321432 // Test if we can query corrupt records.
14331433 withSQLConf(SQLConf .COLUMN_NAME_OF_CORRUPT_RECORD .key -> " _unparsed" ) {
14341434 withTempTable(" jsonTable" ) {
1435- val jsonDF = sqlContext.read.json(additionalCorruptRecords)
1436- jsonDF.registerTempTable(" jsonTable" )
14371435 val schema = StructType (
14381436 StructField (" _unparsed" , StringType , true ) ::
1439- StructField (" dummy" , StringType , true ) :: Nil )
1440-
1441- assert(schema === jsonDF.schema )
1437+ StructField (" dummy" , StringType , true ) :: Nil )
1438+ val jsonDF = sqlContext.read.schema(schema).json(additionalCorruptRecords)
1439+ jsonDF.registerTempTable( " jsonTable " )
14421440
14431441 // In HiveContext, backticks should be used to access columns starting with a underscore.
14441442 checkAnswer(
You can’t perform that action at this time.
0 commit comments