Search in sources :

Example 6 with CacheConfig

use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.

the class TestDomainTranslator method setup.

@BeforeClass
public void setup() {
    metadata = createTestMetadataManager();
    domainTranslator = new RowExpressionDomainTranslator(metadata);
    columnExtractor = new SubfieldExtractor(new FunctionResolution(metadata.getFunctionAndTypeManager()), TEST_EXPRESSION_OPTIMIZER, new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setRangeFiltersOnSubscriptsEnabled(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties())).toColumnExtractor();
}
Also used : RowExpressionDomainTranslator(com.facebook.presto.sql.relational.RowExpressionDomainTranslator) TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) CacheConfig(com.facebook.presto.cache.CacheConfig) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with CacheConfig

use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.

the class TestBackgroundHiveSplitLoader method backgroundHiveSplitLoader.

private static BackgroundHiveSplitLoader backgroundHiveSplitLoader(List<LocatedFileStatus> files, DirectoryLister directoryLister, String fileStatusCacheTables) {
    List<HivePartitionMetadata> hivePartitionMetadatas = ImmutableList.of(new HivePartitionMetadata(new HivePartition(new SchemaTableName("testSchema", "table_name")), Optional.empty(), TableToPartitionMapping.empty(), Optional.empty(), ImmutableSet.of()));
    ConnectorSession connectorSession = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setMaxSplitSize(new DataSize(1.0, GIGABYTE)).setFileStatusCacheTables(fileStatusCacheTables), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
    return new BackgroundHiveSplitLoader(SIMPLE_TABLE, hivePartitionMetadatas, Optional.empty(), createBucketSplitInfo(Optional.empty(), Optional.empty()), connectorSession, new TestingHdfsEnvironment(files), new NamenodeStats(), directoryLister, EXECUTOR, 2, false, false, false);
}
Also used : TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) SchemaTableName(com.facebook.presto.spi.SchemaTableName) DataSize(io.airlift.units.DataSize) ConnectorSession(com.facebook.presto.spi.ConnectorSession) TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) CacheConfig(com.facebook.presto.cache.CacheConfig)

Example 8 with CacheConfig

use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.

the class AbstractTestHiveClientLocal method initialize.

@BeforeClass
public void initialize() {
    tempDir = Files.createTempDir();
    ExtendedHiveMetastore metastore = createMetastore(tempDir);
    metastore.createDatabase(METASTORE_CONTEXT, Database.builder().setDatabaseName(testDbName).setOwnerName("public").setOwnerType(PrincipalType.ROLE).build());
    HiveClientConfig hiveConfig = new HiveClientConfig().setTimeZone("America/Los_Angeles");
    MetastoreClientConfig metastoreClientConfig = new MetastoreClientConfig();
    setup(testDbName, hiveConfig, new CacheConfig(), metastoreClientConfig, metastore);
}
Also used : ExtendedHiveMetastore(com.facebook.presto.hive.metastore.ExtendedHiveMetastore) CacheConfig(com.facebook.presto.cache.CacheConfig) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with CacheConfig

use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.

the class TestHiveFileFormats method testRcTextOptimizedWriter.

@Test(dataProvider = "rowCount")
public void testRcTextOptimizedWriter(int rowCount) throws Exception {
    List<TestColumn> testColumns = TEST_COLUMNS.stream().filter(TestHiveFileFormats::withoutNullMapKeyTests).collect(toImmutableList());
    TestingConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setRcfileOptimizedWriterEnabled(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
    assertThatFileFormat(RCTEXT).withColumns(testColumns).withRowsCount(rowCount).withSession(session).withFileWriterFactory(new RcFileFileWriterFactory(HDFS_ENVIRONMENT, FUNCTION_AND_TYPE_MANAGER, new NodeVersion("test"), HIVE_STORAGE_TIME_ZONE, STATS)).isReadableByRecordCursor(new GenericHiveRecordCursorProvider(HDFS_ENVIRONMENT)).isReadableByPageSource(new RcFilePageSourceFactory(FUNCTION_AND_TYPE_MANAGER, HDFS_ENVIRONMENT, STATS));
}
Also used : TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) CacheConfig(com.facebook.presto.cache.CacheConfig) RcFilePageSourceFactory(com.facebook.presto.hive.rcfile.RcFilePageSourceFactory) Test(org.testng.annotations.Test)

Example 10 with CacheConfig

use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.

the class TestHiveFileFormats method testRcBinaryOptimizedWriter.

@Test(dataProvider = "rowCount")
public void testRcBinaryOptimizedWriter(int rowCount) throws Exception {
    List<TestColumn> testColumns = TEST_COLUMNS.stream().filter(testColumn -> !testColumn.getName().equals("t_empty_varchar")).filter(TestHiveFileFormats::withoutNullMapKeyTests).collect(toList());
    TestingConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setRcfileOptimizedWriterEnabled(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
    assertThatFileFormat(RCBINARY).withColumns(testColumns).withRowsCount(rowCount).withSession(session).withFileWriterFactory(new RcFileFileWriterFactory(HDFS_ENVIRONMENT, FUNCTION_AND_TYPE_MANAGER, new NodeVersion("test"), HIVE_STORAGE_TIME_ZONE, STATS)).isReadableByRecordCursor(new GenericHiveRecordCursorProvider(HDFS_ENVIRONMENT)).isReadableByPageSource(new RcFilePageSourceFactory(FUNCTION_AND_TYPE_MANAGER, HDFS_ENVIRONMENT, STATS));
}
Also used : TestingConnectorSession(com.facebook.presto.testing.TestingConnectorSession) CacheConfig(com.facebook.presto.cache.CacheConfig) RcFilePageSourceFactory(com.facebook.presto.hive.rcfile.RcFilePageSourceFactory) Test(org.testng.annotations.Test)

Aggregations

CacheConfig (com.facebook.presto.cache.CacheConfig)45 Test (org.testng.annotations.Test)33 TestingConnectorSession (com.facebook.presto.testing.TestingConnectorSession)31 ConnectorSession (com.facebook.presto.spi.ConnectorSession)18 Configuration (org.apache.hadoop.conf.Configuration)12 SchemaTableName (com.facebook.presto.spi.SchemaTableName)9 ConnectorPageSource (com.facebook.presto.spi.ConnectorPageSource)8 HiveClientConfig (com.facebook.presto.hive.HiveClientConfig)7 HiveSessionProperties (com.facebook.presto.hive.HiveSessionProperties)7 OrcFileWriterConfig (com.facebook.presto.hive.OrcFileWriterConfig)7 ParquetFileWriterConfig (com.facebook.presto.hive.ParquetFileWriterConfig)7 TestingCacheUtils.stressTest (com.facebook.presto.cache.TestingCacheUtils.stressTest)6 Storage (com.facebook.presto.hive.metastore.Storage)6 File (java.io.File)6 StorageFormat (com.facebook.presto.hive.metastore.StorageFormat)5 OutputStreamDataSinkFactory (com.facebook.presto.hive.datasink.OutputStreamDataSinkFactory)4 RcFilePageSourceFactory (com.facebook.presto.hive.rcfile.RcFilePageSourceFactory)4 DataSize (io.airlift.units.DataSize)4 BeforeClass (org.testng.annotations.BeforeClass)4 CounterStat (com.facebook.airlift.stats.CounterStat)3