Package com.foundationdb.qp.expression

Examples of com.foundationdb.qp.expression.IndexBound


        return plan;
    }

    private IndexKeyRange parentXEq(long x)
    {
        IndexBound xBound = new IndexBound(row(tXIndexRowType, x), new SetColumnSelector(0));
        return IndexKeyRange.bounded(tXIndexRowType, xBound, true, xBound, true);
    }
View Full Code Here


                true);
    }

    private IndexKeyRange nEq(IndexRowType nIndexRowType, long n)
    {
        IndexBound bound = new IndexBound(row(nIndexRowType, n), new SetColumnSelector(0));
        return IndexKeyRange.bounded(nIndexRowType, bound, true, bound, true);
    }
View Full Code Here

        long[] childPKs = new long[] {11, 12, 21, 22};
        int[] orderingMasks = new int[]{ALL_ASCENDING, ALL_DESCENDING};
        for (int orderingMask : orderingMasks) {
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

        int[] orderingMasks = new int[]{ALL_ASCENDING, ALL_DESCENDING};
        for (int orderingMask : orderingMasks) {
            // Empty due to pid1
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                };
                compareRows(expected, cursor(plan, queryContext, queryBindings));
            }
            // Empty due to pid2
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                };
                compareRows(expected, cursor(plan, queryContext, queryBindings));
            }
            // Non-empty
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

        long[] childPKs = new long[] {11, 12, 21, 22};
        int[] orderingMasks = new int[]{ALL_ASCENDING, ALL_DESCENDING};
        for (int orderingMask : orderingMasks) {
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK - 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

    {
        long[] childPKs = new long[] {11, 12, 21, 22};
        for (int orderingMask = 0x0; orderingMask <= 0x7; orderingMask++) {
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound bound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, bound, true, bound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

        long[] childPKs = new long[] {11, 12, 21, 22};
        for (int orderingMask = 0x0; orderingMask <= 0x7; orderingMask++) {
            // Empty due to pid1
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                };
                compareRows(expected, cursor(plan, queryContext, queryBindings));
            }
            // Empty due to pid2
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                };
                compareRows(expected, cursor(plan, queryContext, queryBindings));
            }
                // Non-empty
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

    {
        long[] childPKs = new long[] {11, 12, 21, 22};
        for (int orderingMask = 0x0; orderingMask <= 0x7; orderingMask++) {
            for (long childPK : childPKs) {
                long parentPK = childPK / 10;
                IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK - 1), SELECTOR);
                IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
                IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
                Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
                Row[] expected = new Row[] {
                    row(childRowType, childPK, parentPK, parentPK),
                };
View Full Code Here

        return plan;
    }

    private IndexKeyRange eq(IndexRowType indexRowType, long testId)
    {
        IndexBound testBound = new IndexBound(row(indexRowType, testId), new SetColumnSelector(0));
        return IndexKeyRange.bounded(indexRowType, testBound, true, testBound, true);
    }
View Full Code Here

    @Test
    public void testRestrictedIndexScan()
    {
        Index idxOrderSalesman = orderSalesmanIndexRowType.index();
        IndexBound lo = indexBound(row(orderSalesmanIndexRowType, "jack"), columnSelector(idxOrderSalesman));
        IndexBound hi = indexBound(row(orderSalesmanIndexRowType, "tom"), columnSelector(idxOrderSalesman));
        IndexKeyRange range = indexKeyRange(orderSalesmanIndexRowType, lo, true, hi, false);
        Operator indexScan = indexScan_Default(orderSalesmanIndexRowType, false, range);
        // TODO: Can't compare rows, because we can't yet obtain fields from index rows. So compare hkeys instead
        String[] expected = new String[]{"{1,(long)2,2,(long)22}",
                                         "{1,(long)1,2,(long)11}"};
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.expression.IndexBound

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.