cloud-fan commented on a change in pull request #33212:
URL: https://github.com/apache/spark/pull/33212#discussion_r666912457
##########
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:
nit: `field ${schema(index).name} is not nullable but the parsed value
is null.`
--
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]