HyukjinKwon commented on a change in pull request #34470:
URL: https://github.com/apache/spark/pull/34470#discussion_r769251026



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
##########
@@ -84,6 +84,13 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]]
     AttributeSet.fromAttributeSets(expressions.map(_.references)) -- 
producedAttributes
   }
 
+  /**
+   * Returns true when the all the expressions in the current node as well as 
all of its children
+   * are deterministic
+   */
+  lazy val deterministic: Boolean = expressions.forall(_.deterministic) &&

Review comment:
       can physical plan have a different determinism to ones in logical plan?
   
   e.g., Sample is non-deterministic. I think physical plans of Sample should 
always be non-deterministic. Otherwise, the output will be inconsistent for 
which physical plan is used. The opposite case is the same too.




-- 
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]

Reply via email to