szehon-ho commented on code in PR #52504:
URL: https://github.com/apache/spark/pull/52504#discussion_r2397185816


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ColumnResolutionHelper.scala:
##########
@@ -167,19 +167,22 @@ trait ColumnResolutionHelper extends Logging with 
DataTypeErrorsBase {
           }
         }
 
-        case u @ UnresolvedExtractValue(child, field) =>
+        case u @ UnresolvedExtractValue(child, fieldName) =>
           val newChild = innerResolve(child, isTopLevel = false)
-          val resolvedField = if 
(conf.getConf(SQLConf.PREFER_COLUMN_OVER_LCA_IN_ARRAY_INDEX)) {
-            innerResolve(field, isTopLevel = false)
-          } else {
-            field
-          }
           if (newChild.resolved) {
-            ExtractValue(child = newChild, extraction = resolvedField, 
resolver = resolver)
+            ExtractValue(newChild, fieldName, resolver)
           } else {
-            u.copy(child = newChild, extraction = resolvedField)
+            u.copy(child = newChild)
           }
 
+        case d @ DefaultValueExpression(u: UnresolvedAttribute, _, _) =>
+          d.copy(child = LiteralFunctionResolution.resolve(u.nameParts)
+            .map {
+              case Alias(child, _) if !isTopLevel => child

Review Comment:
   I just copied this from the other code, we dont need it right?



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