Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.ColumnMetadata


            return this;
        }

        public TableMetadataBuilder partitionKeyColumn(String columnName, ColumnType type)
        {
            columns.add(new ColumnMetadata(columnName, type, ordinalPosition++, true));
            return this;
        }
View Full Code Here


            SchemaTableName schemaTable = table.getTable();

            TableEntry entry = new TableEntry(table.getConnectorId(), schemaTable.getSchemaName(), schemaTable.getTableName());

            for (ColumnHandle columnHandle : node.getAssignments().values()) {
                ColumnMetadata columnMetadata = metadata.getColumnMetadata(tableHandle, columnHandle);
                builder.put(entry, columnMetadata.getName());
            }

            return null;
        }
View Full Code Here

            // Create the destination table
            ImmutableList.Builder<ColumnMetadata> columns = ImmutableList.builder();
            for (int i = 0; i < plan.getDescriptor().getFields().size(); i++) {
                Field field = plan.getDescriptor().getFields().get(i);
                String name = field.getName().or("_field" + i);
                ColumnMetadata columnMetadata = new ColumnMetadata(name, field.getType().getColumnType(), i, false);
                columns.add(columnMetadata);
            }

            TableMetadata tableMetadata = createTableMetadata(destination, columns.build());
            targetTable = metadata.createTable(destination.getCatalogName(), tableMetadata);
View Full Code Here

        List<Field> fields = plan.getDescriptor().getFields();
        for (int i = 0; i < fields.size(); i++) {
            Field field = fields.get(i);
            String name = field.getName().get();
            ColumnType type = field.getType().getColumnType();
            columns.add(new ColumnMetadata(name, type, i, false));
        }
        return columns.build();
    }
View Full Code Here

            Map<Symbol, ColumnHandle> assignments = node.getAssignments();

            ImmutableMap.Builder<Symbol, ColumnHandle> newAssignmentsBuilder = ImmutableMap.builder();
            for (Map.Entry<Symbol, ColumnHandle> assignmentEntry : assignments.entrySet()) {
                ColumnMetadata originalColumn = metadata.getColumnMetadata(tableHandle, assignmentEntry.getValue());

                ColumnHandle aliasedColumnHandle = lookupColumns.get(originalColumn.getName());
                checkState(aliasedColumnHandle != null, "no matching column for original column %s found!", originalColumn);
                newAssignmentsBuilder.put(assignmentEntry.getKey(), aliasedColumnHandle);
            }

            return new TableScanNode(node.getId(), aliasTableHandle.get(), node.getOutputSymbols(), newAssignmentsBuilder.build(), node.getOriginalConstraint(), node.getGeneratedPartitions());
View Full Code Here

        return partitionKey;
    }

    public ColumnMetadata getColumnMetadata()
    {
        return new ColumnMetadata(name, hiveType.getNativeType(), ordinalPosition, partitionKey);
    }
View Full Code Here

        this.sources = ImmutableList.copyOf(checkNotNull(sources, "sources is null"));

        int index = 0;
        ImmutableList.Builder<ColumnMetadata> columnsMetadata = ImmutableList.builder();
        for (ExampleColumn column : this.columns) {
            columnsMetadata.add(new ColumnMetadata(column.getName(), column.getType(), index, false));
            index++;
        }
        this.columnsMetadata = columnsMetadata.build();
    }
View Full Code Here

        return ordinalPosition;
    }

    public ColumnMetadata getColumnMetadata()
    {
        return new ColumnMetadata(columnName, columnType, ordinalPosition, false);
    }
View Full Code Here

        return clusteringKey;
    }

    public ColumnMetadata getColumnMetadata()
    {
        return new ColumnMetadata(CassandraCqlUtils.cqlNameToSqlName(name), cassandraType.getNativeType(), ordinalPosition, partitionKey);
    }
View Full Code Here

    private void doCreateTable(SchemaTableName tableName, String tableOwner)
            throws InterruptedException
    {
        // begin creating the table
        List<ColumnMetadata> columns = ImmutableList.<ColumnMetadata>builder()
                .add(new ColumnMetadata("id", ColumnType.LONG, 1, false))
                .build();

        ConnectorTableMetadata tableMetadata = new ConnectorTableMetadata(tableName, columns, tableOwner);
        HiveOutputTableHandle outputHandle = client.beginCreateTable(tableMetadata);
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.ColumnMetadata

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.