Github user chenghao-intel commented on a diff in the pull request: https://github.com/apache/spark/pull/482#discussion_r12125494 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala --- @@ -223,6 +222,11 @@ abstract class Expression extends TreeNode[Expression] { } } +/** + * Root class for rewritten 2 operands UDF expression. By default, we assume it produces Null if + * either one of its operands is null. Exceptional case requires to update the optimization rule + * at [[optimizer.ConstantFolding ConstantFolding]] + */ abstract class BinaryExpression extends Expression with trees.BinaryNode[Expression] { --- End diff -- That's true, adding document restrictions for BinaryExpression / UnaryExpression is quite confusing and error-prone. Besides the BinaryArithmetic, also the rewrite UDFs RLike / Cast / BinaryComparison etc.will be considered, too. Probably enumerate all of the expression types in this rule makes more sense.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---