use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testUsesBucketingWithBucketFilters.
@Test
public void testUsesBucketingWithBucketFilters() {
ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setMaxBucketsForGroupedExecution(100), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
HiveTableHandle tableHandle = new HiveTableHandle(SCHEMA_NAME, TABLE_NAME);
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, tableHandle, new Constraint<>(TupleDomain.withColumnDomains(ImmutableMap.of(new HiveColumnHandle(BUCKET_COLUMN.getName(), BUCKET_COLUMN.getType(), parseTypeSignature(StandardTypes.VARCHAR), 0, REGULAR, Optional.empty(), Optional.empty()), Domain.singleValue(INTEGER, 1L)))), session);
assertTrue(result.getBucketHandle().isPresent(), "bucketHandle is not present");
assertTrue(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testIgnoresBucketingWhenConfigured.
@Test
public void testIgnoresBucketingWhenConfigured() {
ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setIgnoreTableBucketing(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, new HiveTableHandle(SCHEMA_NAME, TABLE_NAME), Constraint.alwaysTrue(), session);
assertFalse(result.getBucketHandle().isPresent(), "bucketHandle is present");
assertFalse(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testUsesBucketingWithBucketColumn.
@Test
public void testUsesBucketingWithBucketColumn() {
ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setMaxBucketsForGroupedExecution(1), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
HiveTableHandle tableHandle = new HiveTableHandle(SCHEMA_NAME, TABLE_NAME);
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, tableHandle, new Constraint<>(TupleDomain.withColumnDomains(ImmutableMap.of(bucketColumnHandle(), Domain.singleValue(INTEGER, 1L)))), session);
assertTrue(result.getBucketHandle().isPresent(), "bucketHandle is not present");
assertTrue(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testUsesBucketingWithPartitionFilters.
@Test
public void testUsesBucketingWithPartitionFilters() {
ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setMaxBucketsForGroupedExecution(100), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
HiveTableHandle tableHandle = new HiveTableHandle(SCHEMA_NAME, TABLE_NAME);
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, tableHandle, new Constraint<>(TupleDomain.withColumnDomains(ImmutableMap.of(new HiveColumnHandle(PARTITION_COLUMN.getName(), PARTITION_COLUMN.getType(), parseTypeSignature(StandardTypes.VARCHAR), MAX_PARTITION_KEY_COLUMN_INDEX, PARTITION_KEY, Optional.empty(), Optional.empty()), Domain.singleValue(VARCHAR, utf8Slice("2019-07-23"))))), session);
assertTrue(result.getBucketHandle().isPresent(), "bucketHandle is not present");
assertFalse(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testUsesBucketingIfSmallEnough.
@Test
public void testUsesBucketingIfSmallEnough() {
HiveTableHandle tableHandle = new HiveTableHandle(SCHEMA_NAME, TABLE_NAME);
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, tableHandle, Constraint.alwaysTrue(), new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig(), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties()));
assertTrue(result.getBucketHandle().isPresent(), "bucketHandle is not present");
assertFalse(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
Aggregations