aokolnychyi commented on code in PR #52504:
URL: https://github.com/apache/spark/pull/52504#discussion_r2414463787
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ColumnResolutionHelper.scala:
##########
@@ -167,19 +167,17 @@ 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(c: Expression, _, _) =>
Review Comment:
I assume this works because we resolve expressions top to bottom, hence we
see DefaultValueExpression before we see the unresolved attribute?
--
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]