Package org.apache.phoenix.expression

Examples of org.apache.phoenix.expression.RowKeyColumnExpression


        if (aggregateFunction == null) {
            int index = groupBy.getExpressions().indexOf(expression);
            if (index >= 0) {
                isAggregate = true;
                RowKeyValueAccessor accessor = new RowKeyValueAccessor(groupBy.getKeyExpressions(), index);
                expression = new RowKeyColumnExpression(expression, accessor, groupBy.getKeyExpressions().get(index).getDataType());
            }
        }
        return expression;
    }
View Full Code Here


    public static Expression kvColumn(PColumn c) {
        return new KeyValueColumnExpression(c);
    }

    public static Expression pkColumn(PColumn c, List<PColumn> columns) {
        return new RowKeyColumnExpression(c, new RowKeyValueAccessor(columns, columns.indexOf(c)));
    }
View Full Code Here

        if (SchemaUtil.isPKColumn(column)) {
            String name = column.getName().getString();
            if (isIndex) {
                name = IndexUtil.getDataColumnName(name);
            }
            return new RowKeyColumnExpression(
                    column,
                    new RowKeyValueAccessor(table.getPKColumns(), pkSlotPosition),
                    name);
        }
       
View Full Code Here

        Expressions expressions = compileStatement(query,binds);
        PColumn aCol = ATABLE.getColumn("A_STRING");
        Expression h = or(
                constantComparison(CompareOp.GREATER_OR_EQUAL, new CountAggregateFunction(),1L),
                constantComparison(CompareOp.EQUAL,
                        new RowKeyColumnExpression(aCol, // a_string comes from group by key in this case
                                new RowKeyValueAccessor(Arrays.<PColumn>asList(aCol), 0)),"foo"));
        assertNull(expressions.whereClause);
        assertEquals(h, expressions.havingClause);
    }
View Full Code Here

        assertEquals(
            new RowKeyComparisonFilter(
                constantComparison(CompareOp.EQUAL,
                    new SubstrFunction(
                        Arrays.<Expression>asList(
                            new RowKeyColumnExpression(ENTITY_ID,new RowKeyValueAccessor(ATABLE.getPKColumns(),1)),
                            LiteralExpression.newConstant(1),
                            LiteralExpression.newConstant(3))
                        ),
                    keyPrefix),
                QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES),
View Full Code Here

            singleKVFilter( // single b/c one column is a row key column
            or(
                constantComparison(
                    CompareOp.EQUAL,
                    new SubstrFunction(Arrays.<Expression> asList(
                        new RowKeyColumnExpression(
                            ENTITY_ID,
                            new RowKeyValueAccessor(ATABLE.getPKColumns(), 1)),
                        LiteralExpression.newConstant(1),
                        LiteralExpression.newConstant(3))),
                    keyPrefix),
View Full Code Here

        if (SchemaUtil.isPKColumn(this.getColumn())) {
            String name = this.getColumn().getName().getString();
            if (isIndex) {
                name = IndexUtil.getDataColumnName(name);
            }
            return new RowKeyColumnExpression(
                    getColumn(),
                    new RowKeyValueAccessor(this.getTable().getPKColumns(), pkSlotPosition),
                    name);
        } else {
            return isIndex
View Full Code Here

        if (aggregateFunction == null) {
            int index = groupBy.getExpressions().indexOf(expression);
            if (index >= 0) {
                isAggregate = true;
                RowKeyValueAccessor accessor = new RowKeyValueAccessor(groupBy.getKeyExpressions(), index);
                expression = new RowKeyColumnExpression(expression, accessor, groupBy.getKeyExpressions().get(index).getDataType());
            }
        }
        return expression;
    }
View Full Code Here

        assertEquals(
            new RowKeyComparisonFilter(
                constantComparison(CompareOp.EQUAL,
                    new SubstrFunction(
                        Arrays.<Expression>asList(
                            new RowKeyColumnExpression(BaseConnectionlessQueryTest.ENTITY_ID,new RowKeyValueAccessor(BaseConnectionlessQueryTest.ATABLE.getPKColumns(),1)),
                            LiteralExpression.newConstant(1),
                            LiteralExpression.newConstant(3))
                        ),
                    keyPrefix), QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES),
            filter);
View Full Code Here

            singleKVFilter( // single b/c one column is a row key column
            or(
                constantComparison(
                    CompareOp.EQUAL,
                    new SubstrFunction(Arrays.<Expression> asList(
                        new RowKeyColumnExpression(
                            BaseConnectionlessQueryTest.ENTITY_ID,
                            new RowKeyValueAccessor(BaseConnectionlessQueryTest.ATABLE.getPKColumns(), 1)),
                        LiteralExpression.newConstant(1),
                        LiteralExpression.newConstant(3))),
                    keyPrefix),
View Full Code Here

TOP

Related Classes of org.apache.phoenix.expression.RowKeyColumnExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.