Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.SchemaTableName


        List<SchemaTableName> tableNames;
        if (prefix.getTableName() == null) {
            tableNames = listTables(prefix.getSchemaName());
        }
        else {
            tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
        }

        for (SchemaTableName tableName : tableNames) {
            JmxTableHandle tableHandle = getTableHandle(tableName);
            columns.put(tableName, tableHandle.getTableMetadata().getColumns());
View Full Code Here


    protected ConnectorRecordSinkProvider recordSinkProvider;

    protected void setupHive(String connectorId, String databaseName, String timeZoneId)
    {
        database = databaseName;
        tablePartitionFormat = new SchemaTableName(database, "presto_test_partition_format");
        tableUnpartitioned = new SchemaTableName(database, "presto_test_unpartitioned");
        tableOffline = new SchemaTableName(database, "presto_test_offline");
        tableOfflinePartition = new SchemaTableName(database, "presto_test_offline_partition");
        view = new SchemaTableName(database, "presto_test_view");
        invalidTable = new SchemaTableName(database, INVALID_TABLE);
        tableBucketedStringInt = new SchemaTableName(database, "presto_test_bucketed_by_string_int");
        tableBucketedBigintBoolean = new SchemaTableName(database, "presto_test_bucketed_by_bigint_boolean");
        tableBucketedDoubleFloat = new SchemaTableName(database, "presto_test_bucketed_by_double_float");
        tablePartitionSchemaChange = new SchemaTableName(database, "presto_test_partition_schema_change");

        temporaryCreateTable = new SchemaTableName(database, "tmp_presto_test_create_" + randomName());
        temporaryCreateSampledTable = new SchemaTableName(database, "tmp_presto_test_create_" + randomName());
        temporaryRenameTableOld = new SchemaTableName(database, "tmp_presto_test_rename_" + randomName());
        temporaryRenameTableNew = new SchemaTableName(database, "tmp_presto_test_rename_" + randomName());
        temporaryCreateView = new SchemaTableName(database, "tmp_presto_test_create_" + randomName());
        tableOwner = "presto_test";

        invalidTableHandle = new HiveTableHandle("hive", database, INVALID_TABLE, SESSION);

        dsColumn = new HiveColumnHandle(connectorId, "ds", 0, HIVE_STRING, StandardTypes.VARCHAR, -1, true);
View Full Code Here

    }

    @Test
    public void testListUnknownSchema()
    {
        assertNull(metadata.getTableHandle(SESSION, new SchemaTableName(INVALID_DATABASE, INVALID_TABLE)));
        assertEquals(metadata.listTables(SESSION, INVALID_DATABASE), ImmutableList.of());
        assertEquals(metadata.listTableColumns(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)), ImmutableMap.of());
        assertEquals(metadata.listViews(SESSION, INVALID_DATABASE), ImmutableList.of());
        assertEquals(metadata.getViews(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)), ImmutableMap.of());
    }
View Full Code Here

    }

    protected void assertGetRecordsOptional(String tableName, String fileType)
            throws Exception
    {
        if (metadata.getTableHandle(SESSION, new SchemaTableName(database, tableName)) != null) {
            assertGetRecords(tableName, fileType);
        }
    }
View Full Code Here

    }

    protected void assertGetRecords(String tableName, String fileType)
            throws Exception
    {
        ConnectorTableHandle tableHandle = getTableHandle(new SchemaTableName(database, tableName));
        ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(tableHandle);
        List<ConnectorColumnHandle> columnHandles = ImmutableList.copyOf(metadata.getColumnHandles(tableHandle).values());
        Map<String, Integer> columnIndex = indexColumns(columnHandles);

        ConnectorPartitionResult partitionResult = splitManager.getPartitions(tableHandle, TupleDomain.<ConnectorColumnHandle>all());
View Full Code Here

    public RecordCursor cursor()
    {
        Builder table = InMemoryRecordSet.builder(ALIAS_TABLE);
        for (TableAlias tableAlias : aliasDao.getAliases()) {
            table.addRow(tableAlias.getSourceConnectorId(),
                    new SchemaTableName(tableAlias.getSourceSchemaName(), tableAlias.getSourceTableName()).toString(),
                    tableAlias.getDestinationConnectorId(),
                    new SchemaTableName(tableAlias.getDestinationSchemaName(), tableAlias.getDestinationTableName()).toString());
        }
        return table.build().cursor();
    }
View Full Code Here

    protected HiveClient client;

    protected void setupHive(String databaseName)
    {
        database = databaseName;
        tableS3 = new SchemaTableName(database, "presto_test_s3");

        String random = UUID.randomUUID().toString().toLowerCase().replace("-", "");
        temporaryCreateTable = new SchemaTableName(database, "tmp_presto_test_create_s3_" + random);
    }
View Full Code Here

    public TableMetadata getTableMetadata(TableHandle tableHandle)
    {
        checkNotNull(tableHandle, "tableHandle is null");
        checkArgument(tableHandle instanceof DualTableHandle, "tableHandle is not a dual table handle");

        SchemaTableName tableName = new SchemaTableName(((DualTableHandle) tableHandle).getSchemaName(), NAME);
        return new TableMetadata(tableName, ImmutableList.of(COLUMN_METADATA));
    }
View Full Code Here

        if (prefix.getTableName() != null && !prefix.getTableName().equals(NAME)) {
            return ImmutableMap.of();
        }

        SchemaTableName tableName = new SchemaTableName(prefix.getSchemaName(), NAME);
        return ImmutableMap.<SchemaTableName, List<ColumnMetadata>>of(tableName, ImmutableList.of(COLUMN_METADATA));
    }
View Full Code Here

    public List<SchemaTableName> listTables(@Nullable String schemaNameOrNull)
    {
        if (schemaNameOrNull == null || TPCH_SCHEMA_NAME.equals(schemaNameOrNull)) {
            ImmutableList.Builder<SchemaTableName> builder = ImmutableList.builder();
            for (String tableName : tables.keySet()) {
                builder.add(new SchemaTableName(TPCH_SCHEMA_NAME, tableName));
            }
            return builder.build();
        }
        return ImmutableList.of();
    }
View Full Code Here

TOP

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

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.