Search in sources :

Example 1 with InListParseNode

use of org.apache.phoenix.parse.InListParseNode in project phoenix by apache.

the class ExpressionCompiler method visitLeave.

@Override
public Expression visitLeave(InListParseNode node, List<Expression> l) throws SQLException {
    List<Expression> inChildren = l;
    Expression firstChild = inChildren.get(0);
    ImmutableBytesWritable ptr = context.getTempPtr();
    PDataType firstChildType = firstChild.getDataType();
    ParseNode firstChildNode = node.getChildren().get(0);
    if (firstChildNode instanceof BindParseNode) {
        PDatum datum = firstChild;
        if (firstChildType == null) {
            datum = inferBindDatum(inChildren);
        }
        context.getBindManager().addParamMetaData((BindParseNode) firstChildNode, datum);
    }
    for (int i = 1; i < l.size(); i++) {
        ParseNode childNode = node.getChildren().get(i);
        if (childNode instanceof BindParseNode) {
            context.getBindManager().addParamMetaData((BindParseNode) childNode, firstChild);
        }
    }
    return wrapGroupByExpression(InListExpression.create(inChildren, node.isNegate(), ptr, context.getCurrentTable().getTable().rowKeyOrderOptimizable()));
}
Also used : PDatum(org.apache.phoenix.schema.PDatum) ImmutableBytesWritable(org.apache.hadoop.hbase.io.ImmutableBytesWritable) PDataType(org.apache.phoenix.schema.types.PDataType) DecimalAddExpression(org.apache.phoenix.expression.DecimalAddExpression) TimestampSubtractExpression(org.apache.phoenix.expression.TimestampSubtractExpression) ArrayConstructorExpression(org.apache.phoenix.expression.ArrayConstructorExpression) Expression(org.apache.phoenix.expression.Expression) LikeExpression(org.apache.phoenix.expression.LikeExpression) ByteBasedLikeExpression(org.apache.phoenix.expression.ByteBasedLikeExpression) DoubleSubtractExpression(org.apache.phoenix.expression.DoubleSubtractExpression) LiteralExpression(org.apache.phoenix.expression.LiteralExpression) InListExpression(org.apache.phoenix.expression.InListExpression) DateSubtractExpression(org.apache.phoenix.expression.DateSubtractExpression) ArrayElemRefExpression(org.apache.phoenix.expression.function.ArrayElemRefExpression) CaseExpression(org.apache.phoenix.expression.CaseExpression) DoubleDivideExpression(org.apache.phoenix.expression.DoubleDivideExpression) NotExpression(org.apache.phoenix.expression.NotExpression) DoubleAddExpression(org.apache.phoenix.expression.DoubleAddExpression) DecimalDivideExpression(org.apache.phoenix.expression.DecimalDivideExpression) RowKeyColumnExpression(org.apache.phoenix.expression.RowKeyColumnExpression) RowValueConstructorExpression(org.apache.phoenix.expression.RowValueConstructorExpression) RoundTimestampExpression(org.apache.phoenix.expression.function.RoundTimestampExpression) StringConcatExpression(org.apache.phoenix.expression.StringConcatExpression) ComparisonExpression(org.apache.phoenix.expression.ComparisonExpression) TimestampAddExpression(org.apache.phoenix.expression.TimestampAddExpression) CoerceExpression(org.apache.phoenix.expression.CoerceExpression) StringBasedLikeExpression(org.apache.phoenix.expression.StringBasedLikeExpression) ArrayAnyComparisonExpression(org.apache.phoenix.expression.function.ArrayAnyComparisonExpression) DecimalSubtractExpression(org.apache.phoenix.expression.DecimalSubtractExpression) ModulusExpression(org.apache.phoenix.expression.ModulusExpression) DoubleMultiplyExpression(org.apache.phoenix.expression.DoubleMultiplyExpression) DecimalMultiplyExpression(org.apache.phoenix.expression.DecimalMultiplyExpression) DateAddExpression(org.apache.phoenix.expression.DateAddExpression) RoundDecimalExpression(org.apache.phoenix.expression.function.RoundDecimalExpression) LongAddExpression(org.apache.phoenix.expression.LongAddExpression) LongSubtractExpression(org.apache.phoenix.expression.LongSubtractExpression) IsNullExpression(org.apache.phoenix.expression.IsNullExpression) AndExpression(org.apache.phoenix.expression.AndExpression) LongMultiplyExpression(org.apache.phoenix.expression.LongMultiplyExpression) ArrayAllComparisonExpression(org.apache.phoenix.expression.function.ArrayAllComparisonExpression) OrExpression(org.apache.phoenix.expression.OrExpression) LongDivideExpression(org.apache.phoenix.expression.LongDivideExpression) BindParseNode(org.apache.phoenix.parse.BindParseNode) ModulusParseNode(org.apache.phoenix.parse.ModulusParseNode) LikeParseNode(org.apache.phoenix.parse.LikeParseNode) UDFParseNode(org.apache.phoenix.parse.UDFParseNode) ComparisonParseNode(org.apache.phoenix.parse.ComparisonParseNode) SequenceValueParseNode(org.apache.phoenix.parse.SequenceValueParseNode) InListParseNode(org.apache.phoenix.parse.InListParseNode) AndParseNode(org.apache.phoenix.parse.AndParseNode) ExistsParseNode(org.apache.phoenix.parse.ExistsParseNode) SubtractParseNode(org.apache.phoenix.parse.SubtractParseNode) NotParseNode(org.apache.phoenix.parse.NotParseNode) DivideParseNode(org.apache.phoenix.parse.DivideParseNode) StringConcatParseNode(org.apache.phoenix.parse.StringConcatParseNode) OrParseNode(org.apache.phoenix.parse.OrParseNode) ParseNode(org.apache.phoenix.parse.ParseNode) LiteralParseNode(org.apache.phoenix.parse.LiteralParseNode) FunctionParseNode(org.apache.phoenix.parse.FunctionParseNode) RowValueConstructorParseNode(org.apache.phoenix.parse.RowValueConstructorParseNode) MultiplyParseNode(org.apache.phoenix.parse.MultiplyParseNode) ColumnParseNode(org.apache.phoenix.parse.ColumnParseNode) CaseParseNode(org.apache.phoenix.parse.CaseParseNode) CastParseNode(org.apache.phoenix.parse.CastParseNode) AddParseNode(org.apache.phoenix.parse.AddParseNode) SubqueryParseNode(org.apache.phoenix.parse.SubqueryParseNode) ArithmeticParseNode(org.apache.phoenix.parse.ArithmeticParseNode) IsNullParseNode(org.apache.phoenix.parse.IsNullParseNode) BindParseNode(org.apache.phoenix.parse.BindParseNode)

Aggregations

ImmutableBytesWritable (org.apache.hadoop.hbase.io.ImmutableBytesWritable)1 AndExpression (org.apache.phoenix.expression.AndExpression)1 ArrayConstructorExpression (org.apache.phoenix.expression.ArrayConstructorExpression)1 ByteBasedLikeExpression (org.apache.phoenix.expression.ByteBasedLikeExpression)1 CaseExpression (org.apache.phoenix.expression.CaseExpression)1 CoerceExpression (org.apache.phoenix.expression.CoerceExpression)1 ComparisonExpression (org.apache.phoenix.expression.ComparisonExpression)1 DateAddExpression (org.apache.phoenix.expression.DateAddExpression)1 DateSubtractExpression (org.apache.phoenix.expression.DateSubtractExpression)1 DecimalAddExpression (org.apache.phoenix.expression.DecimalAddExpression)1 DecimalDivideExpression (org.apache.phoenix.expression.DecimalDivideExpression)1 DecimalMultiplyExpression (org.apache.phoenix.expression.DecimalMultiplyExpression)1 DecimalSubtractExpression (org.apache.phoenix.expression.DecimalSubtractExpression)1 DoubleAddExpression (org.apache.phoenix.expression.DoubleAddExpression)1 DoubleDivideExpression (org.apache.phoenix.expression.DoubleDivideExpression)1 DoubleMultiplyExpression (org.apache.phoenix.expression.DoubleMultiplyExpression)1 DoubleSubtractExpression (org.apache.phoenix.expression.DoubleSubtractExpression)1 Expression (org.apache.phoenix.expression.Expression)1 InListExpression (org.apache.phoenix.expression.InListExpression)1 IsNullExpression (org.apache.phoenix.expression.IsNullExpression)1