You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/04/01 02:03:27 UTC

[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #40630: [SPARK-42997][SQL] TableOutputResolver must use correct column paths in error messages for arrays and maps

dongjoon-hyun commented on code in PR #40630:
URL: https://github.com/apache/spark/pull/40630#discussion_r1155040511


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -179,8 +179,9 @@ object TableOutputResolver {
       addError(s"Cannot write nullable elements to array of non-nulls: '${colPath.quoted}'")
       None
     } else {
-      val param = NamedLambdaVariable("x", inputType.elementType, inputType.containsNull)
-      val fakeAttr = AttributeReference("x", expectedType.elementType, expectedType.containsNull)()
+      val param = NamedLambdaVariable("element", inputType.elementType, inputType.containsNull)

Review Comment:
   May I ask why we need to change variable name from `x` to `element` for this bug?



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -179,8 +179,9 @@ object TableOutputResolver {
       addError(s"Cannot write nullable elements to array of non-nulls: '${colPath.quoted}'")
       None
     } else {
-      val param = NamedLambdaVariable("x", inputType.elementType, inputType.containsNull)
-      val fakeAttr = AttributeReference("x", expectedType.elementType, expectedType.containsNull)()
+      val param = NamedLambdaVariable("element", inputType.elementType, inputType.containsNull)

Review Comment:
   May I ask why we need to change variable name from `x` to `element` for this bug fix?



-- 
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