Search in sources :

Example 1 with TablePropertyManager

use of io.prestosql.metadata.TablePropertyManager in project hetu-core by openlookeng.

the class TestDropCacheTask method setUp.

@BeforeMethod
public void setUp() {
    PropertyService.setProperty(HetuConstant.SPLIT_CACHE_MAP_ENABLED, true);
    SplitCacheMap splitCacheMap = createNew();
    CatalogManager catalogManager = new CatalogManager();
    transactionManager = createTestTransactionManager(catalogManager);
    TablePropertyManager tablePropertyManager = new TablePropertyManager();
    ColumnPropertyManager columnPropertyManager = new ColumnPropertyManager();
    Catalog testCatalog = createBogusTestingCatalog(CATALOG_NAME);
    catalogManager.registerCatalog(testCatalog);
    tablePropertyManager.addProperties(testCatalog.getConnectorCatalogName(), ImmutableList.of(stringProperty("baz", "test property", null, false)));
    columnPropertyManager.addProperties(testCatalog.getConnectorCatalogName(), ImmutableList.of());
    testSession = testSessionBuilder().setTransactionId(transactionManager.beginTransaction(false)).build();
    ColumnMetadata columnMetadataA = new ColumnMetadata("a", BIGINT);
    TupleDomain tupleDomainA = TupleDomain.withColumnDomains(ImmutableMap.of(columnMetadataA, Domain.singleValue(BIGINT, 23L)));
    ColumnMetadata columnMetadataB = new ColumnMetadata("b", BIGINT);
    TupleDomain tupleDomainB = TupleDomain.withColumnDomains(ImmutableMap.of(columnMetadataB, Domain.singleValue(BIGINT, 88L)));
    ColumnMetadata columnMetadataC = new ColumnMetadata("c", BIGINT);
    TupleDomain tupleDomainC = TupleDomain.withColumnDomains(ImmutableMap.of(columnMetadataC, Domain.singleValue(BIGINT, 66L)));
    // Adding entries into SplitCacheMap
    SplitCacheMap.getInstance().addCache(QualifiedName.of(CATALOG_NAME, schema, table), tupleDomainA, "a = 23");
    SplitCacheMap.getInstance().addCache(QualifiedName.of(CATALOG_NAME, schema, table2), tupleDomainB, "b = 88");
    SplitCacheMap.getInstance().addCache(QualifiedName.of(CATALOG_NAME, schema, table3), tupleDomainC, "b = 66");
    stateMachine = createQueryStateMachine("START TRANSACTION", testSession, transactionManager);
}
Also used : ColumnPropertyManager(io.prestosql.metadata.ColumnPropertyManager) ColumnMetadata(io.prestosql.spi.connector.ColumnMetadata) TupleDomain(io.prestosql.spi.predicate.TupleDomain) TablePropertyManager(io.prestosql.metadata.TablePropertyManager) CatalogManager(io.prestosql.metadata.CatalogManager) TestingSession.createBogusTestingCatalog(io.prestosql.testing.TestingSession.createBogusTestingCatalog) Catalog(io.prestosql.metadata.Catalog) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with TablePropertyManager

use of io.prestosql.metadata.TablePropertyManager in project hetu-core by openlookeng.

the class TestCreateTableTask method setUp.

@BeforeMethod
public void setUp() {
    CatalogManager catalogManager = new CatalogManager();
    TransactionManager transactionManager = createTestTransactionManager(catalogManager);
    TablePropertyManager tablePropertyManager = new TablePropertyManager();
    ColumnPropertyManager columnPropertyManager = new ColumnPropertyManager();
    Catalog testCatalog = createBogusTestingCatalog(CATALOG_NAME);
    catalogManager.registerCatalog(testCatalog);
    tablePropertyManager.addProperties(testCatalog.getConnectorCatalogName(), ImmutableList.of(stringProperty("baz", "test property", null, false)));
    columnPropertyManager.addProperties(testCatalog.getConnectorCatalogName(), ImmutableList.of());
    testSession = testSessionBuilder().setTransactionId(transactionManager.beginTransaction(false)).build();
    metadata = new MockMetadata(tablePropertyManager, columnPropertyManager, testCatalog.getConnectorCatalogName(), emptySet());
}
Also used : ColumnPropertyManager(io.prestosql.metadata.ColumnPropertyManager) TransactionManager(io.prestosql.transaction.TransactionManager) InMemoryTransactionManager.createTestTransactionManager(io.prestosql.transaction.InMemoryTransactionManager.createTestTransactionManager) AbstractMockMetadata(io.prestosql.metadata.AbstractMockMetadata) TablePropertyManager(io.prestosql.metadata.TablePropertyManager) CatalogManager(io.prestosql.metadata.CatalogManager) TestingSession.createBogusTestingCatalog(io.prestosql.testing.TestingSession.createBogusTestingCatalog) Catalog(io.prestosql.metadata.Catalog) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Catalog (io.prestosql.metadata.Catalog)2 CatalogManager (io.prestosql.metadata.CatalogManager)2 ColumnPropertyManager (io.prestosql.metadata.ColumnPropertyManager)2 TablePropertyManager (io.prestosql.metadata.TablePropertyManager)2 TestingSession.createBogusTestingCatalog (io.prestosql.testing.TestingSession.createBogusTestingCatalog)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 AbstractMockMetadata (io.prestosql.metadata.AbstractMockMetadata)1 ColumnMetadata (io.prestosql.spi.connector.ColumnMetadata)1 TupleDomain (io.prestosql.spi.predicate.TupleDomain)1 InMemoryTransactionManager.createTestTransactionManager (io.prestosql.transaction.InMemoryTransactionManager.createTestTransactionManager)1 TransactionManager (io.prestosql.transaction.TransactionManager)1