You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/18 23:36:15 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36583: [SPARK-39211][SQL] Support JSON scans with DEFAULT values

HyukjinKwon commented on code in PR #36583:
URL: https://github.com/apache/spark/pull/36583#discussion_r876460895


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:
##########
@@ -419,7 +419,10 @@ class JacksonParser(
     val row = new GenericInternalRow(schema.length)
     var badRecordException: Option[Throwable] = None
     var skipRow = false
-
+    // Apply default values from the column metadata to the initial row, if any.
+    for ((value: Any, i: Int) <- schema.existenceDefaultValues.zipWithIndex) {

Review Comment:
   No biggie but maybe we could add an if-else to skip this assignment if there are no default values (since arguably most cases won't have default values, and this is performance sensitive code path)



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org