Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Incomplete
-
None
-
None
Description
It seems JacksonParser parses the json when the field is not nullable, it parses some data as 0 silently. For example,
val testJson = """{"nullInt":null}""" :: Nil val testSchema = StructType(StructField("nullInt", IntegerType, false) :: Nil) val data = spark.sparkContext.parallelize(testJson) spark.read.schema(testSchema).json(data).show()
shows
+-------+ |nullInt| +-------+ | 0| +-------+
This will also affect from_json function.
Attachments
Issue Links
- is related to
-
SPARK-23173 from_json can produce nulls for fields which are marked as non-nullable
-
- Resolved
-
- links to