Examples of TableRowType


Examples of com.foundationdb.qp.rowtype.TableRowType

                defaultFieldName = indexedField.getName();
            }
        }
        fieldsByRowType = new HashMap<>();
        for (Map.Entry<Column,IndexedField> entry : fieldsByColumn.entrySet()) {
            TableRowType rowType = schema.tableRowType(entry.getKey().getTable());
            List<IndexedField> fields = fieldsByRowType.get(rowType);
            if (fields == null) {
                fields = new ArrayList<>();
                fieldsByRowType.put(rowType, fields);
            }
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

        return generateBranchPlan(table, indexScan, indexType);
    }

    public static Operator generateBranchPlan (Table table, Operator scan, RowType scanType) {
        final Schema schema = (Schema)scanType.schema();
        final TableRowType tableType = schema.tableRowType(table);
        final List<TableRowType> tableTypes = new ArrayList<>();
        tableTypes.add(tableType);
        for (RowType rowType : Schema.descendentTypes(tableType, schema.userTableTypes())) {
            tableTypes.add((TableRowType)rowType);
        }
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

     * AncestorScan (Table)
     *   IndexScan (table, pk->?[, ?])
     */
    public static Operator generateAncestorPlan (AkibanInformationSchema ais, Table table) {
        final Schema schema = SchemaCache.globalSchema(ais);
        TableRowType tableType = schema.tableRowType(table);

        List<TableRowType> ancestorType = new ArrayList<>(1);
        ancestorType.add (tableType);

        IndexRowType indexType = schema.indexRowType(table.getPrimaryKeyIncludingInternal().getIndex());
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

        runAlter(ChangeLevel.TABLE, "ALTER TABLE c ADD COLUMN n INT DEFAULT 0");

        writeRows(row(cid, "e", 3));

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        TableRowType cType = schema.tableRowType(getTable(SCHEMA, C_TABLE));
        StoreAdapter adapter = newStoreAdapter(schema);
        long pk = 1L;
        compareRows(
                new Row[]{
                        testRow(cType, "a", 0, pk++),
                        testRow(cType, "b", 0, pk++),
                        testRow(cType, "c", 0, pk++),
                        testRow(cType, "d", 0, pk++),
                        testRow(cType, "e", 3, pk++),
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
    }
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

        runAlter(ChangeLevel.GROUP, "ALTER TABLE c DROP COLUMN n");

        writeRows(row(cid, "e"));

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        TableRowType cType = schema.tableRowType(getTable(SCHEMA, C_TABLE));
        StoreAdapter adapter = newStoreAdapter(schema);
        long pk = 1L;
        compareRows(
                new Row[]{
                        testRow(cType, "a", pk++),
                        testRow(cType, "b", pk++),
                        testRow(cType, "c", pk++),
                        testRow(cType, "d", pk++),
                        testRow(cType, "e", pk++),
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
    }
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

        return new TestRow(type, fields);
    }

    protected void compareRows(Object[][] expected, Table table) {
        Schema schema = SchemaCache.globalSchema(ais());
        TableRowType rowType = schema.tableRowType(table);
        Row[] rows = new Row[expected.length];
        for (int i = 0; i < expected.length; i++) {
            rows[i] = new TestRow(rowType, expected[i]);
        }
       
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

                BasePlannable insertResult = compiler.compile((DMLStatementNode) insertStmt, null, planContext);
                insertPlan = insertResult.getPlannable();
                deletePlan = new Delete_Returning(insertPlan.getInputOperators().iterator().next(), false);
            }
            int tableID = cs.getTableId();
            TableRowType newType = newSchema.tableRowType(tableID);
            TableTransform transform = buildTableTransform(cs, changeLevel, oldAIS, newType, typesRegistry,
                                                typesTranslator, (Operator)deletePlan, (Operator)insertPlan);
            TableTransform prev = cache.put(tableID, transform);
            assert (prev == null) : tableID;
        }
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

                             boolean hasOldRow, boolean hasNewRow) {
        Plan plan = new Plan();
        plan.ncols = crossReferencedColumns.size();
        Group group = foreignKey.getReferencingTable().getGroup();
        plan.schema = SchemaCache.globalSchema(group.getAIS());
        TableRowType tableRowType = plan.schema.tableRowType(foreignKey.getReferencingTable());
        Operator input;
        if (hasOldRow) {
            // referencing WHERE fk = $1 AND...
            plan.bindOldRow = true;
            List<Column> referencedColumns = foreignKey.getReferencedColumns();
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

    private void checkLimitTable (Object[][] expected, TableName tableName, int limit)
    {
        Table table = ais().getTable(tableName);
        Schema schema = SchemaCache.globalSchema(ais());
        TableRowType rowType = schema.tableRowType(table);
        MemoryAdapter adapter = new MemoryAdapter(schema, session(), configService());

        QueryContext queryContext = new SimpleQueryContext(adapter);
        Row[] rows = objectToRows(expected, rowType);
View Full Code Here

Examples of com.foundationdb.qp.rowtype.TableRowType

   
    private void checkSubsetTable(Object[][] expected, TableName tableName, int columnNum)
    {
        Table table = ais().getTable(tableName);
        Schema schema = SchemaCache.globalSchema(ais());
        TableRowType rowType = schema.tableRowType(table);
        MemoryAdapter adapter = new MemoryAdapter(schema, session(), configService());

        QueryContext queryContext = new SimpleQueryContext(adapter);
       
        List<TPreparedExpression> pExpressions = new ArrayList<>(1);
      
        Value value = new Value(rowType.typeAt(columnNum));
        value.putNull();
        TPreptimeValue ptval = new TPreptimeValue (value.getType(), value);
        pExpressions.add(new TPreparedLiteral(ptval.type(), ptval.value()));
       
        ValuesRowType expectedType = schema.newValuesType(rowType.typeAt(columnNum));
       
        Row[] rows = objectToRows(expected, expectedType);
       
        Cursor cursor = API.cursor(
                API.project_Default(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.