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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -413,8 +413,14 @@ object TableOutputResolver extends SQLConfHelper with 
Logging {
       resolveColumnsByPosition(tableName, Seq(param), Seq(fakeAttr), conf, 
addError, colPath)
     }
     if (res.length == 1) {
-      val func = LambdaFunction(res.head, Seq(param))
-      Some(Alias(ArrayTransform(nullCheckedInput, func), expected.name)())
+      if (res.head == param) {
+        // If the element type is the same, we can reuse the input array 
directly.
+        Some(Alias(nullCheckedInput, expected.name)
+        (nonInheritableMetadataKeys = 
Seq(CharVarcharUtils.CHAR_VARCHAR_TYPE_STRING_METADATA_KEY)))

Review Comment:
   nit
   ```suggestion
           Some(
             Alias(nullCheckedInput, expected.name)(
               nonInheritableMetadataKeys = 
Seq(CharVarcharUtils.CHAR_VARCHAR_TYPE_STRING_METADATA_KEY)))
   ```



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

Reply via email to