Package com.facebook.presto.metadata

Examples of com.facebook.presto.metadata.InternalTable$Builder


        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = ((InformationSchemaSplit) split).getTableHandle();
        Map<String, Object> filters = ((InformationSchemaSplit) split).getFilters();

        InternalTable table = getInformationSchemaTable(handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ColumnHandle column : columns) {
            checkArgument(column instanceof InformationSchemaColumnHandle, "column must be of type %s, not %s", InformationSchemaColumnHandle.class.getName(), column.getClass().getName());
            InformationSchemaColumnHandle internalColumn = (InformationSchemaColumnHandle) column;

            list.add(table.getColumn(internalColumn.getColumnName()));
        }
        return list.build();
    }
View Full Code Here


        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = split.getTableHandle();
        Map<String, Object> filters = split.getFilters();

        InternalTable table = getInformationSchemaTable(handle.getSession(), handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ConnectorColumnHandle column : columns) {
            String columnName = checkType(column, InformationSchemaColumnHandle.class, "column").getColumnName();
            list.add(table.getColumn(columnName));
        }
        return list.build();
    }
View Full Code Here

        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = ((InformationSchemaSplit) split).getTableHandle();
        Map<String, Object> filters = ((InformationSchemaSplit) split).getFilters();

        InternalTable table = getInformationSchemaTable(handle.getSession(), handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ConnectorColumnHandle column : columns) {
            checkArgument(column instanceof InformationSchemaColumnHandle, "column must be of type %s, not %s", InformationSchemaColumnHandle.class.getName(), column.getClass().getName());
            InformationSchemaColumnHandle internalColumn = (InformationSchemaColumnHandle) column;

            list.add(table.getColumn(internalColumn.getColumnName()));
        }
        return list.build();
    }
View Full Code Here

    }

    @Override
    public Operator createNewDataStream(OperatorContext operatorContext, ConnectorSplit split, List<ConnectorColumnHandle> columns)
    {
        InternalTable table = getInternalTable(split, columns);
        ImmutableList.Builder<Type> types = ImmutableList.builder();
        ImmutableList.Builder<Iterable<Block>> channels = ImmutableList.builder();
        for (ConnectorColumnHandle column : columns) {
            String columnName = checkType(column, InformationSchemaColumnHandle.class, "column").getColumnName();
            types.add(table.getType(columnName));
            channels.add(table.getColumn(columnName));
        }
        return new AlignmentOperator(operatorContext, types.build(), channels.build());
    }
View Full Code Here

        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = ((InformationSchemaSplit) split).getTableHandle();
        Map<String, Object> filters = ((InformationSchemaSplit) split).getFilters();

        InternalTable table = getInformationSchemaTable(handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ColumnHandle column : columns) {
            checkArgument(column instanceof InformationSchemaColumnHandle, "column must be of type %s, not %s", InformationSchemaColumnHandle.class.getName(), column.getClass().getName());
            InformationSchemaColumnHandle internalColumn = (InformationSchemaColumnHandle) column;

            list.add(table.getColumn(internalColumn.getColumnName()));
        }
        return list.build();
    }
View Full Code Here

    }

    @Override
    public Operator createNewDataStream(OperatorContext operatorContext, ConnectorSplit split, List<ConnectorColumnHandle> columns)
    {
        InternalTable table = getInternalTable(split, columns);
        ImmutableList.Builder<Type> types = ImmutableList.builder();
        ImmutableList.Builder<Iterable<Block>> channels = ImmutableList.builder();
        for (ConnectorColumnHandle column : columns) {
            String columnName = checkType(column, InformationSchemaColumnHandle.class, "column").getColumnName();
            types.add(table.getType(columnName));
            channels.add(table.getColumn(columnName));
        }
        return new AlignmentOperator(operatorContext, types.build(), channels.build());
    }
View Full Code Here

        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = split.getTableHandle();
        Map<String, Object> filters = split.getFilters();

        InternalTable table = getInformationSchemaTable(handle.getSession(), handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ConnectorColumnHandle column : columns) {
            String columnName = checkType(column, InformationSchemaColumnHandle.class, "column").getColumnName();
            list.add(table.getColumn(columnName));
        }
        return list.build();
    }
View Full Code Here

        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = ((InformationSchemaSplit) split).getTableHandle();
        Map<String, Object> filters = ((InformationSchemaSplit) split).getFilters();

        InternalTable table = getInformationSchemaTable(handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ColumnHandle column : columns) {
            checkArgument(column instanceof InformationSchemaColumnHandle, "column must be of type %s, not %s", InformationSchemaColumnHandle.class.getName(), column.getClass().getName());
            InformationSchemaColumnHandle internalColumn = (InformationSchemaColumnHandle) column;

            list.add(table.getColumn(internalColumn.getColumnName()));
        }
        return list.build();
    }
View Full Code Here

    }

    @Override
    public ConnectorPageSource createPageSource(ConnectorSplit split, List<ConnectorColumnHandle> columns)
    {
        InternalTable table = getInternalTable(split, columns);

        List<Integer> channels = new ArrayList<>();
        for (ConnectorColumnHandle column : columns) {
            String columnName = checkType(column, InformationSchemaColumnHandle.class, "column").getColumnName();
            int columnIndex = table.getColumnIndex(columnName);
            channels.add(columnIndex);
        }

        ImmutableList.Builder<Page> pages = ImmutableList.builder();
        for (Page page : table.getPages()) {
            Block[] blocks = new Block[channels.size()];
            for (int index = 0; index < blocks.length; index++) {
                blocks[index] = page.getBlock(channels.get(index));
            }
            pages.add(new Page(page.getPositionCount(), blocks));
View Full Code Here

        checkArgument(!columns.isEmpty(), "must provide at least one column");

        InformationSchemaTableHandle handle = ((InformationSchemaSplit) split).getTableHandle();
        Map<String, Object> filters = ((InformationSchemaSplit) split).getFilters();

        InternalTable table = getInformationSchemaTable(handle.getCatalogName(), handle.getSchemaTableName(), filters);

        ImmutableList.Builder<BlockIterable> list = ImmutableList.builder();
        for (ColumnHandle column : columns) {
            checkArgument(column instanceof InformationSchemaColumnHandle, "column must be of type %s, not %s", InformationSchemaColumnHandle.class.getName(), column.getClass().getName());
            InformationSchemaColumnHandle internalColumn = (InformationSchemaColumnHandle) column;

            list.add(table.getColumn(internalColumn.getColumnName()));
        }
        return list.build();
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.metadata.InternalTable$Builder

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.