Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.TableHandle


        // TODO: replace this with a table-generating operator that produces 1 row with no columns

        QualifiedTableName name = MetadataUtil.createQualifiedTableName(session, QualifiedName.of("dual"));
        Optional<TableHandle> optionalHandle = metadata.getTableHandle(name);
        checkState(optionalHandle.isPresent(), "Dual table provider not installed");
        TableHandle table = optionalHandle.get();
        TableMetadata tableMetadata = metadata.getTableMetadata(table);
        Map<String, ColumnHandle> columnHandles = metadata.getColumnHandles(table);
        checkState(!metadata.getSampleWeightColumnHandle(table).isPresent(), "dual table should not have a sample weight");

        ImmutableMap.Builder<Symbol, ColumnHandle> columns = ImmutableMap.builder();
View Full Code Here


            extends PlanNodeRewriter<Void>
    {
        @Override
        public PlanNode rewriteTableScan(TableScanNode node, Void context, PlanRewriter<Void> planRewriter)
        {
            TableHandle tableHandle = node.getTable();

            String connectorId = metadata.getConnectorId(tableHandle);
            SchemaTableName tableName = metadata.getTableMetadata(tableHandle).getTable();

            TableAlias tableAlias = aliasDao.getAlias(connectorId, tableName.getSchemaName(), tableName.getTableName());
View Full Code Here

        }
    }

    private TableHandle getTableHandle(SchemaTableName tableName)
    {
        TableHandle handle = metadata.getTableHandle(tableName);
        checkArgument(handle != null, "table not found: %s", tableName);
        return handle;
    }
View Full Code Here

    @Test
    public void testGetRecordsS3()
            throws Exception
    {
        TableHandle table = getTableHandle(tableS3);
        List<ColumnHandle> columnHandles = ImmutableList.copyOf(client.getColumnHandles(table).values());
        Map<String, Integer> columnIndex = indexColumns(columnHandles);

        PartitionResult partitionResult = client.getPartitions(table, TupleDomain.all());
        assertEquals(partitionResult.getPartitions().size(), 1);
View Full Code Here

        // We work around that by using a dummy location when creating the
        // table and update it here to the correct S3 location.
        metastoreClient.updateTableLocation(database, tableName.getTableName(), outputHandle.getTargetPath());

        // load the new table
        TableHandle tableHandle = getTableHandle(tableName);
        List<ColumnHandle> columnHandles = ImmutableList.copyOf(client.getColumnHandles(tableHandle).values());

        // verify the data
        PartitionResult partitionResult = client.getPartitions(tableHandle, TupleDomain.all());
        assertEquals(partitionResult.getPartitions().size(), 1);
View Full Code Here

        }
    }

    private TableHandle getTableHandle(SchemaTableName tableName)
    {
        TableHandle handle = client.getTableHandle(tableName);
        checkArgument(handle != null, "table not found: %s", tableName);
        return handle;
    }
View Full Code Here

    @Test
    public void testGetPartitions()
            throws Exception
    {
        TableHandle tableHandle = getTableHandle(table);
        PartitionResult partitionResult = splitManager.getPartitions(tableHandle, TupleDomain.all());
        assertExpectedPartitions(partitionResult.getPartitions());
    }
View Full Code Here

    @Test
    public void testGetPartitionsWithBindings()
            throws Exception
    {
        TableHandle tableHandle = getTableHandle(table);
        PartitionResult partitionResult = splitManager.getPartitions(tableHandle, TupleDomain.withColumnDomains(ImmutableMap.<ColumnHandle, Domain>of(intColumn, Domain.singleValue(5L))));
        assertExpectedPartitions(partitionResult.getPartitions());
    }
View Full Code Here

    @Test
    public void testGetPartitionNames()
            throws Exception
    {
        TableHandle tableHandle = getTableHandle(table);
        PartitionResult partitionResult = splitManager.getPartitions(tableHandle, TupleDomain.all());
        assertExpectedPartitions(partitionResult.getPartitions());
    }
View Full Code Here

    @Test
    public void testGetPartitionNamesUnpartitioned()
            throws Exception
    {
        TableHandle tableHandle = getTableHandle(tableUnpartitioned);
        PartitionResult partitionResult = splitManager.getPartitions(tableHandle, TupleDomain.all());
        assertEquals(partitionResult.getPartitions().size(), 1);
        assertEquals(partitionResult.getPartitions(), unpartitionedPartitions);
    }
View Full Code Here

TOP

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

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.