Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.Operator


    public void testDDAD()
    {
        API.Ordering ordering = ordering(A, DESC, B, DESC, C, ASC, ID, DESC);
        long[] idOrdering = longs(1014, 1015, 1012, 1013, 1010, 1011);
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, idOrdering, 0);
            testJump(cursor, idOrdering, 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, last4(idOrdering), 0);
            testJump(cursor, last4(idOrdering), 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, first4(idOrdering), 0);
            testJump(cursor, first4(idOrdering), 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, middle2(idOrdering), 0);
            testJump(cursor, middle2(idOrdering), 1);
            cursor.closeTopLevel();
View Full Code Here


    public void testDDDA()
    {
        API.Ordering ordering = ordering(A, DESC, B, DESC, C, DESC, ID, ASC);
        long[] idOrdering = longs(1015, 1014, 1013, 1012, 1011, 1010);
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, idOrdering, 0);
            testJump(cursor, idOrdering, -1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, last4(idOrdering), 0);
            testJump(cursor, last4(idOrdering), -1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, first4(idOrdering), 0);
            testJump(cursor, first4(idOrdering), -1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, middle2(idOrdering), 0);
            testJump(cursor, middle2(idOrdering), -1);
            cursor.closeTopLevel();
View Full Code Here

    public void testDDDD()
    {
        API.Ordering ordering = ordering(A, DESC, B, DESC, C, DESC, ID, DESC);
        long[] idOrdering = longs(1015, 1014, 1013, 1012, 1011, 1010);
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, idOrdering, 0);
            testJump(cursor, idOrdering, 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, true, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, last4(idOrdering), 0);
            testJump(cursor, last4(idOrdering), 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, true), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, first4(idOrdering), 0);
            testJump(cursor, first4(idOrdering), 1);
            cursor.closeTopLevel();
        }
        {
            Operator plan = indexScan_Default(idxRowType, bounded(1, 11, false, 13, false), ordering);
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            testJump(cursor, middle2(idOrdering), 0);
            testJump(cursor, middle2(idOrdering), 1);
            cursor.closeTopLevel();
View Full Code Here

                           int nudge,
                           int lo, boolean loInclusive,
                           int hi, boolean hiInclusive,
                           long expectedArs[][])
    {
        Operator plan = indexScan_Default(idxRowType, bounded(1, lo, loInclusive, hi, hiInclusive), ordering);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        cursor.openTopLevel();
        testJump(cursor,
                 idOrdering,
                 nudge,
View Full Code Here

    public void testLoad()
    {
        loadDB();
        {
            // Check (lat, lon) index
            Operator plan = indexScan_Default(latLonIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{z, id};
            }
            compareRows(rows(latLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon) index
            Operator plan = indexScan_Default(beforeLatLonIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{before(id), z, id};
            }
            compareRows(rows(beforeLatLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (lat, lon, after) index
            Operator plan = indexScan_Default(latLonAfterIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{z, after(id), id};
            }
            compareRows(rows(latLonAfterIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon, after) index
            Operator plan = indexScan_Default(beforeLatLonAfterIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
View Full Code Here

                }
            }
        }
        {
            // Check (lat, lon) index
            Operator plan = indexScan_Default(latLonIndexRowType);
            int rowsRemaining = zToId.size() / 2;
            if ((zToId.size() % 2) == 1) {
                rowsRemaining += 1;
            }
            long[][] expected = new long[rowsRemaining][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                // Only even ids should remain
                if ((id % 2) == 0) {
                    expected[r++] = new long[]{z, id};
                }
            }
            compareRows(rows(latLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon) index
            Operator plan = indexScan_Default(beforeLatLonIndexRowType);
            int rowsRemaining = zToId.size() / 2;
            if ((zToId.size() % 2) == 1) {
                rowsRemaining += 1;
            }
            long[][] expected = new long[rowsRemaining][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                // Only even ids should remain
                if ((id % 2) == 0) {
                    expected[r++] = new long[]{before(id), z, id};
                }
            }
            compareRows(rows(beforeLatLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (lat, lon, after) index
            Operator plan = indexScan_Default(latLonAfterIndexRowType);
            int rowsRemaining = zToId.size() / 2;
            if ((zToId.size() % 2) == 1) {
                rowsRemaining += 1;
            }
            long[][] expected = new long[rowsRemaining][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                // Only even ids should remain
                if ((id % 2) == 0) {
                    expected[r++] = new long[]{z, after(id), id};
                }
            }
            compareRows(rows(latLonAfterIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon, after) index
            Operator plan = indexScan_Default(beforeLatLonAfterIndexRowType);
            int rowsRemaining = zToId.size() / 2;
            if ((zToId.size() % 2) == 1) {
                rowsRemaining += 1;
            }
            long[][] expected = new long[rowsRemaining][];
View Full Code Here

                updateRow(before, after);
            }
        }
        {
            // Check (lat, lon) index
            Operator plan = indexScan_Default(latLonIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{z, id};
            }
            compareRows(rows(latLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon) index
            Operator plan = indexScan_Default(beforeLatLonIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{before(id), z, id};
            }
            compareRows(rows(beforeLatLonIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (lat, lon, after) index
            Operator plan = indexScan_Default(latLonAfterIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
                expected[r++] = new long[]{z, after(id), id};
            }
            compareRows(rows(latLonAfterIndexRowType.physicalRowType(), sort(expected)), cursor(plan, queryContext, queryBindings));
        }
        {
            // Check (before, lat, lon, after) index
            Operator plan = indexScan_Default(beforeLatLonAfterIndexRowType);
            long[][] expected = new long[zToId.size()][];
            int r = 0;
            for (Map.Entry<Long, Integer> entry : zToId.entrySet()) {
                long z = entry.getKey();
                int id = entry.getValue();
View Full Code Here

            IndexBound lowerLeft = new IndexBound(row(latLonIndexRowType, latLo, lonLo),
                                                  new SetColumnSelector(0, 1));
            IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
                                                   new SetColumnSelector(0, 1));
            IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
            Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
            Cursor cursor = API.cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            Row row;
            while ((row = cursor.next()) != null) {
                assertSame(latLonIndexRowType.physicalRowType(), row.rowType());
View Full Code Here

            IndexBound lowerLeft = new IndexBound(row(latLonIndexRowType, latLo, lonLo),
                                                  new SetColumnSelector(0, 1));
            IndexBound upperRight = new IndexBound(row(latLonIndexRowType, latHi, lonHi),
                                                   new SetColumnSelector(0, 1));
            IndexKeyRange box = IndexKeyRange.spatial(latLonIndexRowType, lowerLeft, upperRight);
            Operator plan = indexScan_Default(latLonIndexRowType, box, lookaheadQuantum());
            Cursor cursor = API.cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            Row row;
            while ((row = cursor.next()) != null) {
                assertSame(latLonIndexRowType.physicalRowType(), row.rowType());
View Full Code Here

                IndexBound lowerLeft = new IndexBound(row(beforeLatLonIndexRowType, before, latLo, lonLo),
                                                      new SetColumnSelector(0, 1, 2));
                IndexBound upperRight = new IndexBound(row(beforeLatLonIndexRowType, before, latHi, lonHi),
                                                       new SetColumnSelector(0, 1, 2));
                IndexKeyRange box = IndexKeyRange.spatial(beforeLatLonIndexRowType, lowerLeft, upperRight);
                Operator plan = indexScan_Default(beforeLatLonIndexRowType, box, lookaheadQuantum());
                Cursor cursor = API.cursor(plan, queryContext, queryBindings);
                cursor.openTopLevel();
                Row row;
                while ((row = cursor.next()) != null) {
                    assertSame(beforeLatLonIndexRowType.physicalRowType(), row.rowType());
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.operator.Operator

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.