viirya commented on a change in pull request #30341:
URL: https://github.com/apache/spark/pull/30341#discussion_r523296101
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala
##########
@@ -63,17 +72,21 @@ class InterpretedUnsafeProjection(expressions:
Array[Expression]) extends Unsafe
}
override def initialize(partitionIndex: Int): Unit = {
- expressions.foreach(_.foreach {
+ proxyExpressions.foreach(_.foreach {
case n: Nondeterministic => n.initialize(partitionIndex)
case _ =>
})
}
override def apply(row: InternalRow): UnsafeRow = {
+ if (subExprElimination) {
+ runtime.setInput(row)
+ }
+
// Put the expression results in the intermediate row.
var i = 0
while (i < numFields) {
- values(i) = expressions(i).eval(row)
+ values(i) = proxyExpressions(i).eval(row)
Review comment:
It could be applied to `InterpretedMutableProjection` too. We can add it
gradually like filter.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]