diff --git a/src/main/scala/catalyst/expressions/Expression.scala b/src/main/scala/catalyst/expressions/Expression.scala index 6a01833b6ca0c..97f9f0320dbac 100644 --- a/src/main/scala/catalyst/expressions/Expression.scala +++ b/src/main/scala/catalyst/expressions/Expression.scala @@ -12,11 +12,14 @@ abstract class Expression extends TreeNode[Expression] { * Returns true when an expression is a candidate for static evaluation before the query is * executed. * The following conditions are used to determine suitability for constant folding: - * - A Coalesce is foldable if all of its children are foldable - * - A BinaryExpression is foldable if its both left and right child are foldable. - * - A Not, isNull, or isNotNull is foldable if its child is foldable. - * - A Literal is foldable. - * - A Cast or UnaryMinus is foldable if its child is foldable. + * - A [[expressions.Coalesce Coalesce]] is foldable if all of its children are foldable + * - A [[expressions.BinaryExpression BinaryExpression]] is foldable if its both left and right + * child are foldable + * - A [[expressions.Not Not]], [[expressions.IsNull IsNull]], or [[expressions.IsNotNull IsNotNull]] + * is foldable if its child is foldable. + * - A [[expressions.Literal]] is foldable. + * - A [[expressions.Cast Cast]] or [[expressions.UnaryMinus UnaryMinus]] is foldable if its + * child is foldable. */ // TODO: Supporting more foldable expressions. For example, deterministic Hive UDFs. def foldable: Boolean = false