Package com.foundationdb.qp.rowtype

Examples of com.foundationdb.qp.rowtype.RowType


                if(next != null) {
                    assert next.rowType() == bufferRowType;
                    // Common case coming out of default Sorters
                    if(next instanceof ValuesHolderRow) {
                        ValuesHolderRow valuesRow = (ValuesHolderRow)next;
                        RowType realRowType = bufferRowType.second();
                        List<Value> values = valuesRow.values();
                        next = new ValuesHolderRow(realRowType, values.subList(1, realRowType.nFields() + 1));
                    } else if(next instanceof CompoundRow) {
                        next = ((CompoundRow)next).subRow(bufferRowType.second());
                    } else {
                        throw new IllegalStateException("Unexpected Row: " + next.getClass());
                    }
View Full Code Here


    private static int compare(List<TComparison> comparisons, int count, Row left, int leftOff, Row right, int rightOff) {
        if(comparisons == null) {
            return left.compareTo(right, leftOff, rightOff, count);
        }
        RowType lType = left.rowType();
        RowType rType = right.rowType();
        int li = leftOff;
        int ri = rightOff;
        int c = 0;
        for(int i = 0; (c == 0) && (i < count); ++i, li++, ri++) {
            TComparison comp = comparisons.get(i);
            if(comp == null) {
                c = left.compareTo(right, li, ri, 1);
            } else {
                c = comp.compare(lType.typeAt(li), left.value(li), rType.typeAt(ri), right.value(ri));
            }
        }
        return c;
    }
View Full Code Here

    protected List<Row> getOtherExpected() {
        // Generate what should be in the group index from the group rows
        return runPlanTxn(new OperatorCreator() {
            @Override
            public Operator create(Schema schema) {
                RowType cType = schema.tableRowType(cID);
                RowType oType = schema.tableRowType(oID);
                RowType iType = schema.tableRowType(iID);
                List<ExpressionGenerator> expList = Arrays.asList(
                    ExpressionGenerators.field(iType, 2, 7), // z
                    ExpressionGenerators.field(oType, 2, 4), // y
                    ExpressionGenerators.field(cType, 1, 1), // w
                    ExpressionGenerators.field(cType, 0, 0), // cid
View Full Code Here

            rows[i] = new TestRow(rowType, startID + i, startID + i);
        }
        return new OperatorCreator() {
            @Override
            public Operator create(Schema schema) {
                RowType outType = schema.tableRowType(rowType.typeId());
                return insert_Returning(valuesScan_Default(bindableRows(rows), outType));
            }
        };
    }
View Full Code Here

    protected List<Row> getOtherExpected() {
        // Generate what should be in the table index from the group rows
        return runPlanTxn(new OperatorCreator() {
            @Override
            public Operator create(Schema schema) {
                RowType tType = schema.tableRowType(tID);
                List<ExpressionGenerator> expList = Arrays.asList(
                    ExpressionGenerators.field(tableRowType, 0, 1), // x
                    ExpressionGenerators.field(tableRowType, 1, 0// id
                );
                Ordering ordering = API.ordering();
                for(int i = 0; i < expList.size(); ++i) {
                    TPreparedExpression prep = expList.get(i).getTPreparedExpression();
                    ordering.append(ExpressionGenerators.field(prep.resultType(), i), true);
                }
                Operator plan = API.groupScan_Default(tType.table().getGroup());
                plan = API.project_Default(plan, expList, tType);
                plan = API.sort_General(plan, plan.rowType(), ordering, SortOption.PRESERVE_DUPLICATES);
                return plan;
            }
        });
View Full Code Here

                Arrays.asList(ExpressionGenerators.field(tRowType, 0),
                              ExpressionGenerators.field(tRowType, 1),
                              ExpressionGenerators.field(tRowType, 2),
                              ExpressionGenerators.field(tRowType, 3),
                              ExpressionGenerators.field(tRowType, fillerColumn)));
        RowType inputRowType = setup.rowType();
        int sortComplexity = 0;
        Ordering ordering = ordering();
        for (int f = 0; f < sortFields; f++) {
            boolean ascending = (orderingMask & (1 << f)) != 0;
            ordering.append(ExpressionGenerators.field(inputRowType, f), ascending);
View Full Code Here

    }

    @Test
    public void cycleComplete() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(true));
       
        Row[] rows = new Row[] {
                row(rowType, 1L),
        };
       
View Full Code Here

        compareRows(rows, cursor);
    }

    @Test
    public void cycleNValues() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(false),MNumeric.INT.instance(true), MString.varchar());
        Row[] rows = new Row[] {
                row(rowType, 1L, 100L, "A"),
        };
       
        bindRows.add(BindableRow.of(rows[0]));
View Full Code Here

        compareRows(rows, cursor);
    }
   
    @Test
    public void cycleNRows() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(true));
       
        List<Row> rows = new ArrayList<>();
        for (long i = 0; i < 100; i++) {
            Row row = row (rowType, i);
            rows.add(row);
View Full Code Here

        compareRows (rows.toArray(rowArray), cursor);
    }
   
    @Test
    public void cycleManyRows() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(false), MNumeric.INT.instance(true), MString.varchar());
        List<Row> rows = new ArrayList<>();
        for (long i = 0; i < 100; i++) {
            Row row = row (rowType, random.nextInt(), i,
                    characters(5+random.nextInt(1000)));
            rows.add(row);
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.rowtype.RowType

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.