phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JamesRTaylor <...@git.apache.org>
Subject [GitHub] phoenix pull request #314: PHOENIX-4820
Date Sun, 29 Jul 2018 17:46:08 GMT
Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/314#discussion_r205981903
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/util/ExpressionUtil.java ---
    @@ -68,4 +74,85 @@ public static boolean isPkPositionChanging(TableRef tableRef, List<Expression>
p
             return false;
         }
     
    +    public static boolean isColumnConstant(Expression columnExpression, Expression whereExpression)
{
    +        if(whereExpression == null) {
    +            return false;
    +        }
    +        IsColumnConstantExpressionVisitor isColumnConstantExpressionVisitor =
    +                new IsColumnConstantExpressionVisitor(columnExpression);
    +        whereExpression.accept(isColumnConstantExpressionVisitor);
    +        return isColumnConstantExpressionVisitor.isConstant();
    +    }
    +
    +    private static class IsColumnConstantExpressionVisitor extends StatelessTraverseNoExpressionVisitor<Void>
{
    --- End diff --
    
    I'm hoping we don't need a new visitor here. There are probably other cases to check for
besides ComparisonExpression. For example, InListExpression, maybe CoerceExpression, etc.


---

Mime
View raw message