cloud-fan commented on code in PR #44261:
URL: https://github.com/apache/spark/pull/44261#discussion_r1437456709
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveInlineTables.scala:
##########
@@ -68,17 +68,17 @@ object ResolveInlineTables extends Rule[LogicalPlan]
/**
* Validates that all inline table data are valid expressions that can be
evaluated
* (in this they must be foldable).
- *
+ * Exception are CURRENT_LIKE expressions, which are replaced by a literal
in later stages.
* This is package visible for unit testing.
*/
private[analysis] def validateInputEvaluable(table: UnresolvedInlineTable):
Unit = {
table.rows.foreach { row =>
row.foreach { e =>
- // Note that nondeterministic expressions are not supported since they
are not foldable.
- // Only exception are CURRENT_LIKE expressions, which are replaced by
a literal
- // In later stages.
- if ((!e.resolved && !e.containsPattern(CURRENT_LIKE))
- || !trimAliases(prepareForEval(e)).foldable) {
+ if (e.containsPattern(CURRENT_LIKE)) {
+ return
Review Comment:
nit: we should not use `return` in a lambda, as non-local return is harmful
in general. To simulate this early return code style, we can do
```
if (e.containsPattern(CURRENT_LIKE)) {
// do nothing
} else if (...) ...
```
--
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]