Search in sources :

Example 1 with MaterializedViewPropertyManager

use of io.trino.metadata.MaterializedViewPropertyManager in project trino by trinodb.

the class BaseDataDefinitionTaskTest method setUp.

@BeforeMethod
public void setUp() {
    queryRunner = LocalQueryRunner.create(TEST_SESSION);
    transactionManager = queryRunner.getTransactionManager();
    queryRunner.createCatalog(CATALOG_NAME, MockConnectorFactory.create("initial"), ImmutableMap.of());
    testSession = testSessionBuilder().build();
    metadata = new MockMetadata(new CatalogName(CATALOG_NAME));
    plannerContext = plannerContextBuilder().withMetadata(metadata).build();
    materializedViewPropertyManager = new MaterializedViewPropertyManager();
    materializedViewPropertyManager.addProperties(new CatalogName(CATALOG_NAME), ImmutableList.of(longProperty(MATERIALIZED_VIEW_PROPERTY_1_NAME, "property 1", MATERIALIZED_VIEW_PROPERTY_1_DEFAULT_VALUE, false), stringProperty(MATERIALIZED_VIEW_PROPERTY_2_NAME, "property 2", MATERIALIZED_VIEW_PROPERTY_2_DEFAULT_VALUE, false)));
    queryStateMachine = stateMachine(transactionManager, createTestMetadataManager(), new AllowAllAccessControl(), testSession);
}
Also used : AllowAllAccessControl(io.trino.security.AllowAllAccessControl) AbstractMockMetadata(io.trino.metadata.AbstractMockMetadata) MaterializedViewPropertyManager(io.trino.metadata.MaterializedViewPropertyManager) CatalogName(io.trino.connector.CatalogName) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with MaterializedViewPropertyManager

use of io.trino.metadata.MaterializedViewPropertyManager in project trino by trinodb.

the class TestAnalyzer method createAnalyzer.

private Analyzer createAnalyzer(Session session, AccessControl accessControl) {
    StatementRewrite statementRewrite = new StatementRewrite(ImmutableSet.of(new ShowQueriesRewrite(plannerContext.getMetadata(), plannerContext.getFunctionManager(), SQL_PARSER, accessControl, new SessionPropertyManager(), new SchemaPropertyManager(), new ColumnPropertyManager(), tablePropertyManager, new MaterializedViewPropertyManager())));
    StatementAnalyzerFactory statementAnalyzerFactory = createTestingStatementAnalyzerFactory(plannerContext, accessControl, tablePropertyManager, analyzePropertyManager);
    AnalyzerFactory analyzerFactory = new AnalyzerFactory(statementAnalyzerFactory, statementRewrite);
    return analyzerFactory.createAnalyzer(session, emptyList(), emptyMap(), WarningCollector.NOOP);
}
Also used : ColumnPropertyManager(io.trino.metadata.ColumnPropertyManager) StatementRewrite(io.trino.sql.rewrite.StatementRewrite) SessionPropertyManager(io.trino.metadata.SessionPropertyManager) MaterializedViewPropertyManager(io.trino.metadata.MaterializedViewPropertyManager) ShowQueriesRewrite(io.trino.sql.rewrite.ShowQueriesRewrite) SchemaPropertyManager(io.trino.metadata.SchemaPropertyManager) StatementAnalyzerFactory.createTestingStatementAnalyzerFactory(io.trino.sql.analyzer.StatementAnalyzerFactory.createTestingStatementAnalyzerFactory) StatementAnalyzerFactory.createTestingStatementAnalyzerFactory(io.trino.sql.analyzer.StatementAnalyzerFactory.createTestingStatementAnalyzerFactory)

Aggregations

MaterializedViewPropertyManager (io.trino.metadata.MaterializedViewPropertyManager)2 CatalogName (io.trino.connector.CatalogName)1 AbstractMockMetadata (io.trino.metadata.AbstractMockMetadata)1 ColumnPropertyManager (io.trino.metadata.ColumnPropertyManager)1 SchemaPropertyManager (io.trino.metadata.SchemaPropertyManager)1 SessionPropertyManager (io.trino.metadata.SessionPropertyManager)1 AllowAllAccessControl (io.trino.security.AllowAllAccessControl)1 StatementAnalyzerFactory.createTestingStatementAnalyzerFactory (io.trino.sql.analyzer.StatementAnalyzerFactory.createTestingStatementAnalyzerFactory)1 ShowQueriesRewrite (io.trino.sql.rewrite.ShowQueriesRewrite)1 StatementRewrite (io.trino.sql.rewrite.StatementRewrite)1 BeforeMethod (org.testng.annotations.BeforeMethod)1