vladimirg-db commented on code in PR #49958:
URL: https://github.com/apache/spark/pull/49958#discussion_r1957292510
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/NondeterministicExpressionCollection.scala:
##########
@@ -25,21 +25,24 @@ object NondeterministicExpressionCollection {
def getNondeterministicToAttributes(
expressions: Seq[Expression]): LinkedHashMap[Expression,
NamedExpression] = {
val nonDeterministicToAttributes = new LinkedHashMap[Expression,
NamedExpression]
- expressions
- .filterNot(_.deterministic)
- .flatMap { expr =>
+
+ for (expr <- expressions) {
+ if (!expr.deterministic) {
val leafNondeterministic = expr.collect {
- case n: Nondeterministic => n
+ case nondeterministicExpr: Nondeterministic => nondeterministicExpr
Review Comment:
One-letter variables are generally discouraged in software engineering. As
this kind of code evolves, it becomes increasingly more messy.
--
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]