Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[SPARK-29444] Fix suite tests
  • Loading branch information
stczwd committed Oct 13, 2019
commit 143b9e7b29d712ea2a440a2b2414071ef6a5824a
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class JacksonGeneratorSuite extends SparkFunSuite {
assert(writer.toString === """{"a":1}""")
}

test("SPARK-29444: initial with StructType and write out an empty row with allowStructIncludeNull=true") {
test("SPARK-29444: initial with StructType and write out an empty row " +
"with allowStructIncludeNull=true") {
val dataType = StructType(StructField("a", IntegerType) :: Nil)
val input = InternalRow(null)
val writer = new CharArrayWriter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ class JsonFileFormat extends TextBasedFileFormat with DataSourceRegister {
options: Map[String, String],
dataSchema: StructType): OutputWriterFactory = {
val conf = job.getConfiguration
val optionsFromConf =
Map("structIngoreNull" ->
sparkSession.sessionState.conf.jsonGeneratorStructIngoreNull.toString)
val parsedOptions = new JSONOptions(
optionsFromConf ++ options,
options,
sparkSession.sessionState.conf.sessionLocalTimeZone,
sparkSession.sessionState.conf.columnNameOfCorruptRecord)
parsedOptions.compressionCodec.foreach { codec =>
Expand Down