dejankrak-db commented on code in PR #56239:
URL: https://github.com/apache/spark/pull/56239#discussion_r3337671689
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -2040,13 +2046,20 @@ class SessionCatalog(
}
}
+ val funcInputMetadata = new MetadataBuilder()
+ .putBoolean(SessionCatalog.SQL_FUNCTION_PARAMETER_ALIAS_METADATA_KEY,
true)
+ .build()
val inputCast = paddedInput.zip(param.fields).map {
case (expr, param) =>
// Add outer references to all attributes in the function input.
val outer = expr.transform {
case a: Attribute => OuterReference(a)
}
- Alias(Cast(outer, param.dataType), param.name)(qualifier = qualifier)
+ // Mark the alias as function input so name resolution can give a
parameterless
Review Comment:
@cloud-fan, good catch - the table-function marker was never consumed
(outer-reference path). Dropped it from makeSQLTableFunctionPlan, gated the
CREATE-time marker to scalar functions, and reworded the TVF test as a
regression guard for the pre-existing function-vs-outer-reference precedence.
--
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]