Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/6570#discussion_r31494578
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
---
@@ -37,6 +37,13 @@ abstract class Expression extends TreeNode[Expression] {
* - A [[Cast]] or [[UnaryMinus]] is foldable if its child is foldable
*/
def foldable: Boolean = false
+
+ /**
+ * Returns true when an expressions always return the same result for a
specific set of
+ * input values.
+ */
+ // TODO: Need to well define what are explicit input values and implicit
input values.
+ def deterministic: Boolean = true
--- End diff --
Oh I understand the TODO now... It seems better be holistic about
expressing an expression's determinism. Otherwise, you leave the burden of tree
traversal to the user, which could be more error prone. But I agree that
either could work given proper documentation.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]