cloud-fan commented on a change in pull request #33212:
URL: https://github.com/apache/spark/pull/33212#discussion_r666914473
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
##########
@@ -399,16 +399,24 @@ class JacksonParser(
val row = new GenericInternalRow(schema.length)
var badRecordException: Option[Throwable] = None
var skipRow = false
+ var checkedIndexSet = Set.empty[Int]
structFilters.reset()
while (!skipRow && nextUntil(parser, JsonToken.END_OBJECT)) {
schema.getFieldIndex(parser.getCurrentName) match {
case Some(index) =>
try {
- row.update(index, fieldConverters(index).apply(parser))
+ val fieldValue = fieldConverters(index).apply(parser)
+ if (!schema(index).nullable && fieldValue == null) {
+ throw new IllegalSchemaArgumentException(
+ s"the null value found when parsing non-nullable field
${schema(index).name}.")
Review comment:
Do we need to check here? I think
https://github.com/apache/spark/pull/33212/files#diff-ca601f0051c7c452605d0c5884167447a8673ec0c9095c347d5f67c09506e2ddR432
covers it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]