Search in sources :

Example 1 with Constraint

use of com.facebook.presto.spi.Constraint in project presto by prestodb.

the class HivePartitionManager method getPartitions.

public HivePartitionResult getPartitions(SemiTransactionalHiveMetastore metastore, ConnectorTableHandle tableHandle, Constraint<ColumnHandle> constraint) {
    HiveTableHandle hiveTableHandle = (HiveTableHandle) tableHandle;
    TupleDomain<ColumnHandle> effectivePredicate = constraint.getSummary();
    SchemaTableName tableName = hiveTableHandle.getSchemaTableName();
    Table table = getTable(metastore, tableName);
    Optional<HiveBucketHandle> hiveBucketHandle = getHiveBucketHandle(connectorId, table);
    List<HiveColumnHandle> partitionColumns = getPartitionKeyColumnHandles(connectorId, table);
    List<HiveBucket> buckets = getHiveBucketNumbers(table, effectivePredicate);
    TupleDomain<HiveColumnHandle> compactEffectivePredicate = toCompactTupleDomain(effectivePredicate, domainCompactionThreshold);
    if (effectivePredicate.isNone()) {
        return new HivePartitionResult(partitionColumns, ImmutableList.of(), TupleDomain.none(), TupleDomain.none(), hiveBucketHandle);
    }
    if (partitionColumns.isEmpty()) {
        return new HivePartitionResult(partitionColumns, ImmutableList.of(new HivePartition(tableName, compactEffectivePredicate, buckets)), effectivePredicate, TupleDomain.none(), hiveBucketHandle);
    }
    List<Type> partitionTypes = partitionColumns.stream().map(column -> typeManager.getType(column.getTypeSignature())).collect(toList());
    List<String> partitionNames = getFilteredPartitionNames(metastore, tableName, partitionColumns, effectivePredicate);
    // do a final pass to filter based on fields that could not be used to filter the partitions
    int partitionCount = 0;
    ImmutableList.Builder<HivePartition> partitions = ImmutableList.builder();
    for (String partitionName : partitionNames) {
        Optional<Map<ColumnHandle, NullableValue>> values = parseValuesAndFilterPartition(partitionName, partitionColumns, partitionTypes, constraint);
        if (values.isPresent()) {
            if (partitionCount == maxPartitions) {
                throw new PrestoException(HIVE_EXCEEDED_PARTITION_LIMIT, format("Query over table '%s' can potentially read more than %s partitions", hiveTableHandle.getSchemaTableName(), maxPartitions));
            }
            partitionCount++;
            partitions.add(new HivePartition(tableName, compactEffectivePredicate, partitionName, values.get(), buckets));
        }
    }
    // All partition key domains will be fully evaluated, so we don't need to include those
    TupleDomain<ColumnHandle> remainingTupleDomain = TupleDomain.withColumnDomains(Maps.filterKeys(effectivePredicate.getDomains().get(), not(Predicates.in(partitionColumns))));
    TupleDomain<ColumnHandle> enforcedTupleDomain = TupleDomain.withColumnDomains(Maps.filterKeys(effectivePredicate.getDomains().get(), Predicates.in(partitionColumns)));
    return new HivePartitionResult(partitionColumns, partitions.build(), remainingTupleDomain, enforcedTupleDomain, hiveBucketHandle);
}
Also used : DateTimeZone(org.joda.time.DateTimeZone) Table(com.facebook.presto.hive.metastore.Table) TypeManager(com.facebook.presto.spi.type.TypeManager) Slice(io.airlift.slice.Slice) HiveUtil.getPartitionKeyColumnHandles(com.facebook.presto.hive.HiveUtil.getPartitionKeyColumnHandles) Strings.isNullOrEmpty(com.google.common.base.Strings.isNullOrEmpty) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) ProtectMode(org.apache.hadoop.hive.metastore.ProtectMode) PrestoException(com.facebook.presto.spi.PrestoException) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) SchemaTableName(com.facebook.presto.spi.SchemaTableName) ImmutableList(com.google.common.collect.ImmutableList) Predicates.not(com.google.common.base.Predicates.not) ValueSet(com.facebook.presto.spi.predicate.ValueSet) Type(com.facebook.presto.spi.type.Type) Map(java.util.Map) Objects.requireNonNull(java.util.Objects.requireNonNull) Predicates(com.google.common.base.Predicates) HiveBucket(com.facebook.presto.hive.HiveBucketing.HiveBucket) NullableValue(com.facebook.presto.spi.predicate.NullableValue) HIVE_EXCEEDED_PARTITION_LIMIT(com.facebook.presto.hive.HiveErrorCode.HIVE_EXCEEDED_PARTITION_LIMIT) ImmutableMap(com.google.common.collect.ImmutableMap) ProtectMode.getProtectModeFromString(org.apache.hadoop.hive.metastore.ProtectMode.getProtectModeFromString) Constraint(com.facebook.presto.spi.Constraint) SemiTransactionalHiveMetastore(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore) HiveBucketing.getHiveBucketHandle(com.facebook.presto.hive.HiveBucketing.getHiveBucketHandle) Maps(com.google.common.collect.Maps) String.format(java.lang.String.format) TupleDomain(com.facebook.presto.spi.predicate.TupleDomain) Domain(com.facebook.presto.spi.predicate.Domain) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) TableNotFoundException(com.facebook.presto.spi.TableNotFoundException) NOT_SUPPORTED(com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED) ColumnHandle(com.facebook.presto.spi.ColumnHandle) HiveBucketing.getHiveBucketNumbers(com.facebook.presto.hive.HiveBucketing.getHiveBucketNumbers) FileUtils(org.apache.hadoop.hive.common.FileUtils) Optional(java.util.Optional) HiveUtil.parsePartitionValue(com.facebook.presto.hive.HiveUtil.parsePartitionValue) HiveBucket(com.facebook.presto.hive.HiveBucketing.HiveBucket) ImmutableList(com.google.common.collect.ImmutableList) PrestoException(com.facebook.presto.spi.PrestoException) ProtectMode.getProtectModeFromString(org.apache.hadoop.hive.metastore.ProtectMode.getProtectModeFromString) ColumnHandle(com.facebook.presto.spi.ColumnHandle) Table(com.facebook.presto.hive.metastore.Table) SchemaTableName(com.facebook.presto.spi.SchemaTableName) Constraint(com.facebook.presto.spi.Constraint) Type(com.facebook.presto.spi.type.Type) HiveBucketing.getHiveBucketHandle(com.facebook.presto.hive.HiveBucketing.getHiveBucketHandle) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 2 with Constraint

use of com.facebook.presto.spi.Constraint in project presto by prestodb.

the class HivePartitionManager method parseValuesAndFilterPartition.

private Optional<Map<ColumnHandle, NullableValue>> parseValuesAndFilterPartition(String partitionName, List<HiveColumnHandle> partitionColumns, List<Type> partitionTypes, Constraint<ColumnHandle> constraint) {
    List<String> partitionValues = extractPartitionKeyValues(partitionName);
    Map<ColumnHandle, Domain> domains = constraint.getSummary().getDomains().get();
    ImmutableMap.Builder<ColumnHandle, NullableValue> builder = ImmutableMap.builder();
    for (int i = 0; i < partitionColumns.size(); i++) {
        HiveColumnHandle column = partitionColumns.get(i);
        NullableValue parsedValue = parsePartitionValue(partitionName, partitionValues.get(i), partitionTypes.get(i), timeZone);
        Domain allowedDomain = domains.get(column);
        if (allowedDomain != null && !allowedDomain.includesNullableValue(parsedValue.getValue())) {
            return Optional.empty();
        }
        builder.put(column, parsedValue);
    }
    Map<ColumnHandle, NullableValue> values = builder.build();
    if (!constraint.predicate().test(values)) {
        return Optional.empty();
    }
    return Optional.of(values);
}
Also used : ColumnHandle(com.facebook.presto.spi.ColumnHandle) NullableValue(com.facebook.presto.spi.predicate.NullableValue) ProtectMode.getProtectModeFromString(org.apache.hadoop.hive.metastore.ProtectMode.getProtectModeFromString) TupleDomain(com.facebook.presto.spi.predicate.TupleDomain) Domain(com.facebook.presto.spi.predicate.Domain) ImmutableMap(com.google.common.collect.ImmutableMap) Constraint(com.facebook.presto.spi.Constraint)

Example 3 with Constraint

use of com.facebook.presto.spi.Constraint in project presto by prestodb.

the class ConnectorMetadata method getInsertLayout.

/**
     * Get the physical layout for a inserting into an existing table.
     */
default default Optional<ConnectorNewTableLayout> getInsertLayout(ConnectorSession session, ConnectorTableHandle tableHandle) {
    List<ConnectorTableLayout> layouts = getTableLayouts(session, tableHandle, new Constraint<>(TupleDomain.all(), map -> true), Optional.empty()).stream().map(ConnectorTableLayoutResult::getTableLayout).filter(layout -> layout.getNodePartitioning().isPresent()).collect(toList());
    if (layouts.isEmpty()) {
        return Optional.empty();
    }
    if (layouts.size() > 1) {
        throw new PrestoException(NOT_SUPPORTED, "Tables with multiple layouts can not be written");
    }
    ConnectorTableLayout layout = layouts.get(0);
    ConnectorPartitioningHandle partitioningHandle = layout.getNodePartitioning().get().getPartitioningHandle();
    Map<ColumnHandle, String> columnNamesByHandle = getColumnHandles(session, tableHandle).entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));
    List<String> partitionColumns = layout.getNodePartitioning().get().getPartitioningColumns().stream().map(columnNamesByHandle::get).collect(toList());
    return Optional.of(new ConnectorNewTableLayout(partitioningHandle, partitionColumns));
}
Also used : Slice(io.airlift.slice.Slice) ConnectorTableLayoutHandle(com.facebook.presto.spi.ConnectorTableLayoutHandle) GENERIC_INTERNAL_ERROR(com.facebook.presto.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) PrestoException(com.facebook.presto.spi.PrestoException) TableIdentity(com.facebook.presto.spi.TableIdentity) Privilege(com.facebook.presto.spi.security.Privilege) OptionalLong(java.util.OptionalLong) SchemaTableName(com.facebook.presto.spi.SchemaTableName) Map(java.util.Map) ConnectorInsertTableHandle(com.facebook.presto.spi.ConnectorInsertTableHandle) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) Collections.emptyMap(java.util.Collections.emptyMap) Collections.emptyList(java.util.Collections.emptyList) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout) Collection(java.util.Collection) ColumnIdentity(com.facebook.presto.spi.ColumnIdentity) Set(java.util.Set) Constraint(com.facebook.presto.spi.Constraint) ConnectorResolvedIndex(com.facebook.presto.spi.ConnectorResolvedIndex) Collectors(java.util.stream.Collectors) ConnectorSession(com.facebook.presto.spi.ConnectorSession) TupleDomain(com.facebook.presto.spi.predicate.TupleDomain) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) ColumnMetadata(com.facebook.presto.spi.ColumnMetadata) SchemaTablePrefix(com.facebook.presto.spi.SchemaTablePrefix) NOT_SUPPORTED(com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED) ColumnHandle(com.facebook.presto.spi.ColumnHandle) ConnectorNewTableLayout(com.facebook.presto.spi.ConnectorNewTableLayout) Optional(java.util.Optional) ConnectorViewDefinition(com.facebook.presto.spi.ConnectorViewDefinition) ColumnHandle(com.facebook.presto.spi.ColumnHandle) PrestoException(com.facebook.presto.spi.PrestoException) ConnectorNewTableLayout(com.facebook.presto.spi.ConnectorNewTableLayout) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout) Map(java.util.Map) Collections.emptyMap(java.util.Collections.emptyMap)

Example 4 with Constraint

use of com.facebook.presto.spi.Constraint in project presto by prestodb.

the class MetadataManager method getLayouts.

@Override
public List<TableLayoutResult> getLayouts(Session session, TableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) {
    if (constraint.getSummary().isNone()) {
        return ImmutableList.of();
    }
    ConnectorId connectorId = table.getConnectorId();
    ConnectorTableHandle connectorTable = table.getConnectorHandle();
    CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId);
    ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId);
    ConnectorTransactionHandle transaction = catalogMetadata.getTransactionHandleFor(connectorId);
    ConnectorSession connectorSession = session.toConnectorSession(connectorId);
    List<ConnectorTableLayoutResult> layouts = metadata.getTableLayouts(connectorSession, connectorTable, constraint, desiredColumns);
    return layouts.stream().map(layout -> new TableLayoutResult(fromConnectorLayout(connectorId, transaction, layout.getTableLayout()), layout.getUnenforcedConstraint())).collect(toImmutableList());
}
Also used : TypeManager(com.facebook.presto.spi.type.TypeManager) TypeRegistry(com.facebook.presto.type.TypeRegistry) BETWEEN(com.facebook.presto.spi.function.OperatorType.BETWEEN) ConnectorTransactionHandle(com.facebook.presto.spi.connector.ConnectorTransactionHandle) TableIdentity(com.facebook.presto.spi.TableIdentity) BIGINT(com.facebook.presto.spi.type.BigintType.BIGINT) Privilege(com.facebook.presto.spi.security.Privilege) ObjectMapperProvider(io.airlift.json.ObjectMapperProvider) SchemaTableName(com.facebook.presto.spi.SchemaTableName) HashMultimap(com.google.common.collect.HashMultimap) BOOLEAN(com.facebook.presto.spi.type.BooleanType.BOOLEAN) Map(java.util.Map) ImmutableCollectors.toImmutableList(com.facebook.presto.util.ImmutableCollectors.toImmutableList) LESS_THAN(com.facebook.presto.spi.function.OperatorType.LESS_THAN) LESS_THAN_OR_EQUAL(com.facebook.presto.spi.function.OperatorType.LESS_THAN_OR_EQUAL) ENGLISH(java.util.Locale.ENGLISH) ImmutableSet(com.google.common.collect.ImmutableSet) EQUAL(com.facebook.presto.spi.function.OperatorType.EQUAL) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) ConnectorResolvedIndex(com.facebook.presto.spi.ConnectorResolvedIndex) String.format(java.lang.String.format) ConnectorSession(com.facebook.presto.spi.ConnectorSession) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) TupleDomain(com.facebook.presto.spi.predicate.TupleDomain) List(java.util.List) ColumnMetadata(com.facebook.presto.spi.ColumnMetadata) OperatorType(com.facebook.presto.spi.function.OperatorType) QualifiedObjectName.convertFromSchemaTableName(com.facebook.presto.metadata.QualifiedObjectName.convertFromSchemaTableName) JsonCodecFactory(io.airlift.json.JsonCodecFactory) Entry(java.util.Map.Entry) Optional(java.util.Optional) GREATER_THAN(com.facebook.presto.spi.function.OperatorType.GREATER_THAN) ConnectorId(com.facebook.presto.connector.ConnectorId) Joiner(com.google.common.base.Joiner) JsonCodec(io.airlift.json.JsonCodec) TypeSignature(com.facebook.presto.spi.type.TypeSignature) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) QualifiedName(com.facebook.presto.sql.tree.QualifiedName) Slice(io.airlift.slice.Slice) HASH_CODE(com.facebook.presto.spi.function.OperatorType.HASH_CODE) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) HashMap(java.util.HashMap) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) PrestoException(com.facebook.presto.spi.PrestoException) Multimap(com.google.common.collect.Multimap) ArrayList(java.util.ArrayList) ConcurrentMap(java.util.concurrent.ConcurrentMap) Inject(javax.inject.Inject) LinkedHashMap(java.util.LinkedHashMap) OptionalLong(java.util.OptionalLong) BlockEncodingSerde(com.facebook.presto.spi.block.BlockEncodingSerde) ImmutableList(com.google.common.collect.ImmutableList) Type(com.facebook.presto.spi.type.Type) Objects.requireNonNull(java.util.Objects.requireNonNull) TransactionManager(com.facebook.presto.transaction.TransactionManager) LinkedHashSet(java.util.LinkedHashSet) ConnectorInsertTableHandle(com.facebook.presto.spi.ConnectorInsertTableHandle) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) NOT_EQUAL(com.facebook.presto.spi.function.OperatorType.NOT_EQUAL) ConnectorOutputMetadata(com.facebook.presto.spi.connector.ConnectorOutputMetadata) Session(com.facebook.presto.Session) CatalogSchemaName(com.facebook.presto.spi.CatalogSchemaName) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout) ColumnIdentity(com.facebook.presto.spi.ColumnIdentity) Constraint(com.facebook.presto.spi.Constraint) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) INVALID_VIEW(com.facebook.presto.spi.StandardErrorCode.INVALID_VIEW) TypeDeserializer(com.facebook.presto.type.TypeDeserializer) SYNTAX_ERROR(com.facebook.presto.spi.StandardErrorCode.SYNTAX_ERROR) SchemaTablePrefix(com.facebook.presto.spi.SchemaTablePrefix) ColumnHandle(com.facebook.presto.spi.ColumnHandle) ViewColumn(com.facebook.presto.metadata.ViewDefinition.ViewColumn) QueryId(com.facebook.presto.spi.QueryId) GREATER_THAN_OR_EQUAL(com.facebook.presto.spi.function.OperatorType.GREATER_THAN_OR_EQUAL) ConnectorNewTableLayout(com.facebook.presto.spi.ConnectorNewTableLayout) VisibleForTesting(com.google.common.annotations.VisibleForTesting) TransactionManager.createTestTransactionManager(com.facebook.presto.transaction.TransactionManager.createTestTransactionManager) TableLayout.fromConnectorLayout(com.facebook.presto.metadata.TableLayout.fromConnectorLayout) ConnectorViewDefinition(com.facebook.presto.spi.ConnectorViewDefinition) BlockEncodingManager(com.facebook.presto.block.BlockEncodingManager) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorTransactionHandle(com.facebook.presto.spi.connector.ConnectorTransactionHandle) ConnectorSession(com.facebook.presto.spi.ConnectorSession) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorId(com.facebook.presto.connector.ConnectorId) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle)

Example 5 with Constraint

use of com.facebook.presto.spi.Constraint in project presto by prestodb.

the class AbstractTestHiveClient method testGetPartitionNames.

@Test
public void testGetPartitionNames() throws Exception {
    try (Transaction transaction = newTransaction()) {
        ConnectorMetadata metadata = transaction.getMetadata();
        ConnectorTableHandle tableHandle = getTableHandle(metadata, tablePartitionFormat);
        List<ConnectorTableLayoutResult> tableLayoutResults = metadata.getTableLayouts(newSession(), tableHandle, new Constraint<>(TupleDomain.all(), bindings -> true), Optional.empty());
        assertExpectedTableLayout(getOnlyElement(tableLayoutResults).getTableLayout(), tableLayout);
    }
}
Also used : RecordPageSource(com.facebook.presto.spi.RecordPageSource) DateTimeZone(org.joda.time.DateTimeZone) Arrays(java.util.Arrays) ConnectorSplitSource(com.facebook.presto.spi.ConnectorSplitSource) TypeManager(com.facebook.presto.spi.type.TypeManager) Assertions.assertInstanceOf(io.airlift.testing.Assertions.assertInstanceOf) FileSystem(org.apache.hadoop.fs.FileSystem) TypeRegistry(com.facebook.presto.type.TypeRegistry) SqlDate(com.facebook.presto.spi.type.SqlDate) Test(org.testng.annotations.Test) HIVE_PARTITION_SCHEMA_MISMATCH(com.facebook.presto.hive.HiveErrorCode.HIVE_PARTITION_SCHEMA_MISMATCH) Maps.uniqueIndex(com.google.common.collect.Maps.uniqueIndex) FileStatus(org.apache.hadoop.fs.FileStatus) ROLLBACK_AFTER_BEGIN_INSERT(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_AFTER_BEGIN_INSERT) ConnectorTransactionHandle(com.facebook.presto.spi.connector.ConnectorTransactionHandle) BIGINT(com.facebook.presto.spi.type.BigintType.BIGINT) Sets.difference(com.google.common.collect.Sets.difference) BOOLEAN(com.facebook.presto.spi.type.BooleanType.BOOLEAN) ExtendedHiveMetastore(com.facebook.presto.hive.metastore.ExtendedHiveMetastore) ROLLBACK_AFTER_DELETE(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_AFTER_DELETE) Map(java.util.Map) ConnectorPageSink(com.facebook.presto.spi.ConnectorPageSink) HIVE_LONG(com.facebook.presto.hive.HiveType.HIVE_LONG) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) StandardTypes(com.facebook.presto.spi.type.StandardTypes) HiveWriteUtils.createDirectory(com.facebook.presto.hive.HiveWriteUtils.createDirectory) ConnectorPageSourceProvider(com.facebook.presto.spi.connector.ConnectorPageSourceProvider) ENGLISH(java.util.Locale.ENGLISH) Assert.assertFalse(org.testng.Assert.assertFalse) TINYINT(com.facebook.presto.spi.type.TinyintType.TINYINT) StorageFormat(com.facebook.presto.hive.metastore.StorageFormat) PrincipalPrivileges(com.facebook.presto.hive.metastore.PrincipalPrivileges) Set(java.util.Set) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) SemiTransactionalHiveMetastore(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore) ConnectorSession(com.facebook.presto.spi.ConnectorSession) ROW(com.facebook.presto.spi.type.StandardTypes.ROW) Domain(com.facebook.presto.spi.predicate.Domain) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) BridgingHiveMetastore(com.facebook.presto.hive.metastore.BridgingHiveMetastore) HivePrivilegeInfo(com.facebook.presto.hive.metastore.HivePrivilegeInfo) ParquetPageSource(com.facebook.presto.hive.parquet.ParquetPageSource) MoreObjects.toStringHelper(com.google.common.base.MoreObjects.toStringHelper) Iterables(com.google.common.collect.Iterables) DOUBLE(com.facebook.presto.spi.type.DoubleType.DOUBLE) Table(com.facebook.presto.hive.metastore.Table) Slice(io.airlift.slice.Slice) REGULAR(com.facebook.presto.hive.HiveColumnHandle.ColumnType.REGULAR) MoreExecutors.newDirectExecutorService(com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService) HiveUtil.columnExtraInfo(com.facebook.presto.hive.HiveUtil.columnExtraInfo) UTC_KEY(com.facebook.presto.spi.type.TimeZoneKey.UTC_KEY) MapType(com.facebook.presto.type.MapType) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) ROLLBACK_AFTER_SINK_FINISH(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_AFTER_SINK_FINISH) ARRAY(com.facebook.presto.spi.type.StandardTypes.ARRAY) Float.floatToRawIntBits(java.lang.Float.floatToRawIntBits) Type(com.facebook.presto.spi.type.Type) RCTEXT(com.facebook.presto.hive.HiveStorageFormat.RCTEXT) JSON(com.facebook.presto.hive.HiveStorageFormat.JSON) TIMESTAMP(com.facebook.presto.spi.type.TimestampType.TIMESTAMP) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) TestException(org.testng.TestException) AfterClass(org.testng.annotations.AfterClass) HYPER_LOG_LOG(com.facebook.presto.spi.type.HyperLogLogType.HYPER_LOG_LOG) Constraint(com.facebook.presto.spi.Constraint) IOException(java.io.IOException) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) Range(com.facebook.presto.spi.predicate.Range) TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) MoreFutures.getFutureValue(io.airlift.concurrent.MoreFutures.getFutureValue) UTC(org.joda.time.DateTimeZone.UTC) HostAndPort(com.google.common.net.HostAndPort) RCBINARY(com.facebook.presto.hive.HiveStorageFormat.RCBINARY) VarcharType.createUnboundedVarcharType(com.facebook.presto.spi.type.VarcharType.createUnboundedVarcharType) ConnectorSplit(com.facebook.presto.spi.ConnectorSplit) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) HivePrivilege(com.facebook.presto.hive.metastore.HivePrivilegeInfo.HivePrivilege) SchemaTablePrefix(com.facebook.presto.spi.SchemaTablePrefix) ColumnHandle(com.facebook.presto.spi.ColumnHandle) SqlVarbinary(com.facebook.presto.spi.type.SqlVarbinary) ROLLBACK_RIGHT_AWAY(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_RIGHT_AWAY) TableType(org.apache.hadoop.hive.metastore.TableType) HiveMetadata.convertToPredicate(com.facebook.presto.hive.HiveMetadata.convertToPredicate) TypeSignature.parseTypeSignature(com.facebook.presto.spi.type.TypeSignature.parseTypeSignature) ThriftHiveMetastore(com.facebook.presto.hive.metastore.ThriftHiveMetastore) ConnectorViewDefinition(com.facebook.presto.spi.ConnectorViewDefinition) HiveTestUtils.getDefaultHiveDataStreamFactories(com.facebook.presto.hive.HiveTestUtils.getDefaultHiveDataStreamFactories) ViewNotFoundException(com.facebook.presto.spi.ViewNotFoundException) ORC(com.facebook.presto.hive.HiveStorageFormat.ORC) HiveTestUtils.getDefaultHiveFileWriterFactories(com.facebook.presto.hive.HiveTestUtils.getDefaultHiveFileWriterFactories) ROLLBACK_AFTER_FINISH_INSERT(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_AFTER_FINISH_INSERT) HiveType.toHiveType(com.facebook.presto.hive.HiveType.toHiveType) ParquetHiveRecordCursor(com.facebook.presto.hive.parquet.ParquetHiveRecordCursor) Duration(io.airlift.units.Duration) MaterializedResult.materializeSourceDataStream(com.facebook.presto.testing.MaterializedResult.materializeSourceDataStream) SqlTimestamp(com.facebook.presto.spi.type.SqlTimestamp) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) SchemaTableName(com.facebook.presto.spi.SchemaTableName) HIVE_METASTORE_ERROR(com.facebook.presto.hive.HiveErrorCode.HIVE_METASTORE_ERROR) Iterables.concat(com.google.common.collect.Iterables.concat) AVRO(com.facebook.presto.hive.HiveStorageFormat.AVRO) BUCKETED_BY_PROPERTY(com.facebook.presto.hive.HiveTableProperties.BUCKETED_BY_PROPERTY) TypeSignatureParameter(com.facebook.presto.spi.type.TypeSignatureParameter) Path(org.apache.hadoop.fs.Path) DiscretePredicates(com.facebook.presto.spi.DiscretePredicates) NullableValue(com.facebook.presto.spi.predicate.NullableValue) TEXTFILE(com.facebook.presto.hive.HiveStorageFormat.TEXTFILE) ConnectorSplitManager(com.facebook.presto.spi.connector.ConnectorSplitManager) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) TimeZone(java.util.TimeZone) BeforeClass(org.testng.annotations.BeforeClass) Collection(java.util.Collection) DWRF(com.facebook.presto.hive.HiveStorageFormat.DWRF) UUID(java.util.UUID) Assert.assertNotNull(org.testng.Assert.assertNotNull) String.format(java.lang.String.format) COMMIT(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.COMMIT) Preconditions.checkState(com.google.common.base.Preconditions.checkState) STORAGE_FORMAT_PROPERTY(com.facebook.presto.hive.HiveTableProperties.STORAGE_FORMAT_PROPERTY) TupleDomain(com.facebook.presto.spi.predicate.TupleDomain) HIVE_STRING(com.facebook.presto.hive.HiveType.HIVE_STRING) RecordCursor(com.facebook.presto.spi.RecordCursor) List(java.util.List) ColumnMetadata(com.facebook.presto.spi.ColumnMetadata) NOT_SUPPORTED(com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED) TYPE_MANAGER(com.facebook.presto.hive.HiveTestUtils.TYPE_MANAGER) Optional(java.util.Optional) INTEGER(com.facebook.presto.spi.type.IntegerType.INTEGER) PARTITION_KEY(com.facebook.presto.hive.HiveColumnHandle.ColumnType.PARTITION_KEY) Varchars.isVarcharType(com.facebook.presto.spi.type.Varchars.isVarcharType) NoHdfsAuthentication(com.facebook.presto.hive.authentication.NoHdfsAuthentication) JsonCodec(io.airlift.json.JsonCodec) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) Assert.assertNull(org.testng.Assert.assertNull) Logger(io.airlift.log.Logger) Column(com.facebook.presto.hive.metastore.Column) ArrayType(com.facebook.presto.type.ArrayType) RcFilePageSource(com.facebook.presto.hive.rcfile.RcFilePageSource) HiveTestUtils.getTypes(com.facebook.presto.hive.HiveTestUtils.getTypes) ConnectorTableLayoutHandle(com.facebook.presto.spi.ConnectorTableLayoutHandle) HIVE_INVALID_PARTITION_VALUE(com.facebook.presto.hive.HiveErrorCode.HIVE_INVALID_PARTITION_VALUE) HadoopFileStatus(com.facebook.presto.hadoop.HadoopFileStatus) Assert.assertEquals(org.testng.Assert.assertEquals) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) PrestoException(com.facebook.presto.spi.PrestoException) OptionalInt(java.util.OptionalInt) PARQUET(com.facebook.presto.hive.HiveStorageFormat.PARQUET) Partition(com.facebook.presto.hive.metastore.Partition) MAP(com.facebook.presto.spi.type.StandardTypes.MAP) HashSet(java.util.HashSet) ROLLBACK_AFTER_APPEND_PAGE(com.facebook.presto.hive.AbstractTestHiveClient.TransactionDeleteInsertTestTag.ROLLBACK_AFTER_APPEND_PAGE) HIVE_INT(com.facebook.presto.hive.HiveType.HIVE_INT) OrcPageSource(com.facebook.presto.hive.orc.OrcPageSource) ImmutableList(com.google.common.collect.ImmutableList) PARTITIONED_BY_PROPERTY(com.facebook.presto.hive.HiveTableProperties.PARTITIONED_BY_PROPERTY) ValueSet(com.facebook.presto.spi.predicate.ValueSet) SESSION(com.facebook.presto.hive.HiveTestUtils.SESSION) Threads.daemonThreadsNamed(io.airlift.concurrent.Threads.daemonThreadsNamed) NamedTypeSignature(com.facebook.presto.spi.type.NamedTypeSignature) Objects.requireNonNull(java.util.Objects.requireNonNull) Math.toIntExact(java.lang.Math.toIntExact) ConnectorPageSinkProvider(com.facebook.presto.spi.connector.ConnectorPageSinkProvider) SEQUENCEFILE(com.facebook.presto.hive.HiveStorageFormat.SEQUENCEFILE) VARBINARY(com.facebook.presto.spi.type.VarbinaryType.VARBINARY) ExecutorService(java.util.concurrent.ExecutorService) ConnectorInsertTableHandle(com.facebook.presto.spi.ConnectorInsertTableHandle) CachingHiveMetastore(com.facebook.presto.hive.metastore.CachingHiveMetastore) UTF_8(java.nio.charset.StandardCharsets.UTF_8) ConnectorTableLayout(com.facebook.presto.spi.ConnectorTableLayout) Assert.fail(org.testng.Assert.fail) DateTime(org.joda.time.DateTime) SMALLINT(com.facebook.presto.spi.type.SmallintType.SMALLINT) Executors.newFixedThreadPool(java.util.concurrent.Executors.newFixedThreadPool) MaterializedResult(com.facebook.presto.testing.MaterializedResult) Assertions.assertEqualsIgnoreOrder(io.airlift.testing.Assertions.assertEqualsIgnoreOrder) Collectors.toList(java.util.stream.Collectors.toList) ConnectorPageSource(com.facebook.presto.spi.ConnectorPageSource) TableNotFoundException(com.facebook.presto.spi.TableNotFoundException) DATE(com.facebook.presto.spi.type.DateType.DATE) REAL(com.facebook.presto.spi.type.RealType.REAL) BUCKET_COUNT_PROPERTY(com.facebook.presto.hive.HiveTableProperties.BUCKET_COUNT_PROPERTY) Executors.newCachedThreadPool(java.util.concurrent.Executors.newCachedThreadPool) MaterializedRow(com.facebook.presto.testing.MaterializedRow) Assert.assertTrue(org.testng.Assert.assertTrue) ImmutableCollectors(com.facebook.presto.util.ImmutableCollectors) GroupByHashPageIndexerFactory(com.facebook.presto.GroupByHashPageIndexerFactory) Chars.isCharType(com.facebook.presto.spi.type.Chars.isCharType) JoinCompiler(com.facebook.presto.sql.gen.JoinCompiler) HiveTestUtils.getDefaultHiveRecordCursorProvider(com.facebook.presto.hive.HiveTestUtils.getDefaultHiveRecordCursorProvider) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) Test(org.testng.annotations.Test)

Aggregations

ColumnHandle (com.facebook.presto.spi.ColumnHandle)21 Constraint (com.facebook.presto.spi.Constraint)21 TupleDomain (com.facebook.presto.spi.predicate.TupleDomain)21 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)20 SchemaTableName (com.facebook.presto.spi.SchemaTableName)20 ColumnMetadata (com.facebook.presto.spi.ColumnMetadata)19 ConnectorOutputTableHandle (com.facebook.presto.spi.ConnectorOutputTableHandle)19 ConnectorSession (com.facebook.presto.spi.ConnectorSession)19 ConnectorTableLayoutResult (com.facebook.presto.spi.ConnectorTableLayoutResult)19 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)19 Table (com.facebook.presto.hive.metastore.Table)18 TableNotFoundException (com.facebook.presto.spi.TableNotFoundException)18 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)18 BIGINT (com.facebook.presto.spi.type.BigintType.BIGINT)18 TypeRegistry (com.facebook.presto.type.TypeRegistry)18 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)18 GroupByHashPageIndexerFactory (com.facebook.presto.GroupByHashPageIndexerFactory)17 ImmutableMap (com.google.common.collect.ImmutableMap)14 Slice (io.airlift.slice.Slice)14 List (java.util.List)14