@@ -1814,7 +1814,7 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
18141814
18151815 assert(new File (path).listFiles().exists(_.getName.endsWith(" .gz" )))
18161816
1817- val jsonDF = spark.read.option(" wholeFile " , true ).json(path)
1817+ val jsonDF = spark.read.option(" multiLine " , true ).json(path)
18181818 val jsonDir = new File (dir, " json" ).getCanonicalPath
18191819 jsonDF.coalesce(1 ).write
18201820 .option(" compression" , " gZiP" )
@@ -1836,7 +1836,7 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
18361836 .write
18371837 .text(path)
18381838
1839- val jsonDF = spark.read.option(" wholeFile " , true ).json(path)
1839+ val jsonDF = spark.read.option(" multiLine " , true ).json(path)
18401840 val jsonDir = new File (dir, " json" ).getCanonicalPath
18411841 jsonDF.coalesce(1 ).write.json(jsonDir)
18421842
@@ -1865,7 +1865,7 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
18651865 .write
18661866 .text(path)
18671867
1868- val jsonDF = spark.read.option(" wholeFile " , true ).json(path)
1868+ val jsonDF = spark.read.option(" multiLine " , true ).json(path)
18691869 // no corrupt record column should be created
18701870 assert(jsonDF.schema === StructType (Seq ()))
18711871 // only the first object should be read
@@ -1886,7 +1886,7 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
18861886 .write
18871887 .text(path)
18881888
1889- val jsonDF = spark.read.option(" wholeFile " , true ).option(" mode" , " PERMISSIVE" ).json(path)
1889+ val jsonDF = spark.read.option(" multiLine " , true ).option(" mode" , " PERMISSIVE" ).json(path)
18901890 assert(jsonDF.count() === corruptRecordCount)
18911891 assert(jsonDF.schema === new StructType ()
18921892 .add(" _corrupt_record" , StringType )
@@ -1917,7 +1917,7 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
19171917 .write
19181918 .text(path)
19191919
1920- val jsonDF = spark.read.option(" wholeFile " , true ).option(" mode" , " DROPMALFORMED" ).json(path)
1920+ val jsonDF = spark.read.option(" multiLine " , true ).option(" mode" , " DROPMALFORMED" ).json(path)
19211921 checkAnswer(jsonDF, Seq (Row (" test" )))
19221922 }
19231923 }
@@ -1940,15 +1940,15 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData {
19401940 // `FAILFAST` mode should throw an exception for corrupt records.
19411941 val exceptionOne = intercept[SparkException ] {
19421942 spark.read
1943- .option(" wholeFile " , true )
1943+ .option(" multiLine " , true )
19441944 .option(" mode" , " FAILFAST" )
19451945 .json(path)
19461946 }
19471947 assert(exceptionOne.getMessage.contains(" Failed to infer a common schema" ))
19481948
19491949 val exceptionTwo = intercept[SparkException ] {
19501950 spark.read
1951- .option(" wholeFile " , true )
1951+ .option(" multiLine " , true )
19521952 .option(" mode" , " FAILFAST" )
19531953 .schema(schema)
19541954 .json(path)
0 commit comments