Search in sources :

Example 31 with MockConnectorTableHandle

use of io.trino.connector.MockConnectorTableHandle in project trino by trinodb.

the class TestEventListenerBasic method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() throws Exception {
    Session session = testSessionBuilder().setSystemProperty("task_concurrency", "1").setCatalog("tpch").setSchema("tiny").setClientInfo("{\"clientVersion\":\"testVersion\"}").build();
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).setNodeCount(1).build();
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    queryRunner.installPlugin(new ResourceGroupManagerPlugin());
    queryRunner.createCatalog("tpch", "tpch");
    queryRunner.installPlugin(new Plugin() {

        @Override
        public Iterable<ConnectorFactory> getConnectorFactories() {
            MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListTables((session, s) -> ImmutableList.of(new SchemaTableName("default", "tests_table"))).withGetColumns(schemaTableName -> ImmutableList.of(new ColumnMetadata("test_varchar", createVarcharType(15)), new ColumnMetadata("test_bigint", BIGINT))).withGetTableHandle((session, schemaTableName) -> {
                if (!schemaTableName.getTableName().startsWith("create")) {
                    return new MockConnectorTableHandle(schemaTableName);
                }
                return null;
            }).withApplyProjection((session, handle, projections, assignments) -> {
                if (((MockConnectorTableHandle) handle).getTableName().getTableName().equals("tests_table")) {
                    throw new RuntimeException("Throw from apply projection");
                }
                return Optional.empty();
            }).withGetViews((connectorSession, prefix) -> {
                ConnectorViewDefinition definition = new ConnectorViewDefinition("SELECT nationkey AS test_column FROM tpch.tiny.nation", Optional.empty(), Optional.empty(), ImmutableList.of(new ConnectorViewDefinition.ViewColumn("test_column", BIGINT.getTypeId())), Optional.empty(), Optional.empty(), true);
                SchemaTableName viewName = new SchemaTableName("default", "test_view");
                return ImmutableMap.of(viewName, definition);
            }).withGetMaterializedViews((connectorSession, prefix) -> {
                ConnectorMaterializedViewDefinition definition = new ConnectorMaterializedViewDefinition("SELECT nationkey AS test_column FROM tpch.tiny.nation", Optional.empty(), Optional.empty(), Optional.empty(), ImmutableList.of(new Column("test_column", BIGINT.getTypeId())), Optional.empty(), Optional.of("alice"), ImmutableMap.of());
                SchemaTableName materializedViewName = new SchemaTableName("default", "test_materialized_view");
                return ImmutableMap.of(materializedViewName, definition);
            }).withRowFilter(schemaTableName -> {
                if (schemaTableName.getTableName().equals("test_table_with_row_filter")) {
                    return new ViewExpression("user", Optional.of("tpch"), Optional.of("tiny"), "EXISTS (SELECT 1 FROM nation WHERE name = test_varchar)");
                }
                return null;
            }).withColumnMask((schemaTableName, columnName) -> {
                if (schemaTableName.getTableName().equals("test_table_with_column_mask") && columnName.equals("test_varchar")) {
                    return new ViewExpression("user", Optional.of("tpch"), Optional.of("tiny"), "(SELECT cast(max(orderkey) AS varchar(15)) FROM orders)");
                }
                return null;
            }).build();
            return ImmutableList.of(connectorFactory);
        }
    });
    queryRunner.createCatalog("mock", "mock", ImmutableMap.of());
    queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
    queries = new EventsAwaitingQueries(generatedEvents, queryRunner, Duration.ofSeconds(1));
    return queryRunner;
}
Also used : TestingEventListenerPlugin(io.trino.execution.TestEventListenerPlugin.TestingEventListenerPlugin) QueryId(io.trino.spi.QueryId) MaterializedResult(io.trino.testing.MaterializedResult) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) QueryCreatedEvent(io.trino.spi.eventlistener.QueryCreatedEvent) QueryFailureInfo(io.trino.spi.eventlistener.QueryFailureInfo) Test(org.testng.annotations.Test) TableInfo(io.trino.spi.eventlistener.TableInfo) ConnectorMaterializedViewDefinition(io.trino.spi.connector.ConnectorMaterializedViewDefinition) AbstractTestQueryFramework(io.trino.testing.AbstractTestQueryFramework) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) MockConnectorFactory(io.trino.connector.MockConnectorFactory) Duration(java.time.Duration) ConnectorViewDefinition(io.trino.spi.connector.ConnectorViewDefinition) TpchPlugin(io.trino.plugin.tpch.TpchPlugin) Assert.assertFalse(org.testng.Assert.assertFalse) ImmutableSet(com.google.common.collect.ImmutableSet) TestingEventListenerPlugin(io.trino.execution.TestEventListenerPlugin.TestingEventListenerPlugin) ImmutableMap(com.google.common.collect.ImmutableMap) ViewExpression(io.trino.spi.security.ViewExpression) Set(java.util.Set) SchemaTableName(io.trino.spi.connector.SchemaTableName) Executors(java.util.concurrent.Executors) String.format(java.lang.String.format) Plugin(io.trino.spi.Plugin) Resources.getResource(com.google.common.io.Resources.getResource) List(java.util.List) TestingSession.testSessionBuilder(io.trino.testing.TestingSession.testSessionBuilder) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) Session(io.trino.Session) QueryCompletedEvent(io.trino.spi.eventlistener.QueryCompletedEvent) DataProvider(org.testng.annotations.DataProvider) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) RoutineInfo(io.trino.spi.eventlistener.RoutineInfo) Assert.assertEquals(org.testng.Assert.assertEquals) Column(io.trino.spi.connector.ConnectorMaterializedViewDefinition.Column) EventFilters(io.trino.execution.EventsCollector.EventFilters) ColumnDetail(io.trino.spi.eventlistener.ColumnDetail) ImmutableList(com.google.common.collect.ImmutableList) OutputColumnMetadata(io.trino.spi.eventlistener.OutputColumnMetadata) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) ConnectorFactory(io.trino.spi.connector.ConnectorFactory) ExecutorService(java.util.concurrent.ExecutorService) QueryStatistics(io.trino.spi.eventlistener.QueryStatistics) MoreCollectors.toOptional(com.google.common.collect.MoreCollectors.toOptional) MoreExecutors.shutdownAndAwaitTermination(com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination) ResourceGroupManagerPlugin(io.trino.plugin.resourcegroups.ResourceGroupManagerPlugin) Language(org.intellij.lang.annotations.Language) ColumnInfo(io.trino.spi.eventlistener.ColumnInfo) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) File(java.io.File) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) UUID.randomUUID(java.util.UUID.randomUUID) TestQueues.createResourceGroupId(io.trino.execution.TestQueues.createResourceGroupId) QueryRunner(io.trino.testing.QueryRunner) Assert.assertTrue(org.testng.Assert.assertTrue) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) MockConnectorFactory(io.trino.connector.MockConnectorFactory) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) OutputColumnMetadata(io.trino.spi.eventlistener.OutputColumnMetadata) TpchPlugin(io.trino.plugin.tpch.TpchPlugin) ConnectorMaterializedViewDefinition(io.trino.spi.connector.ConnectorMaterializedViewDefinition) SchemaTableName(io.trino.spi.connector.SchemaTableName) ConnectorViewDefinition(io.trino.spi.connector.ConnectorViewDefinition) ViewExpression(io.trino.spi.security.ViewExpression) Column(io.trino.spi.connector.ConnectorMaterializedViewDefinition.Column) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) ResourceGroupManagerPlugin(io.trino.plugin.resourcegroups.ResourceGroupManagerPlugin) Session(io.trino.Session) TpchPlugin(io.trino.plugin.tpch.TpchPlugin) TestingEventListenerPlugin(io.trino.execution.TestEventListenerPlugin.TestingEventListenerPlugin) Plugin(io.trino.spi.Plugin) ResourceGroupManagerPlugin(io.trino.plugin.resourcegroups.ResourceGroupManagerPlugin)

Example 32 with MockConnectorTableHandle

use of io.trino.connector.MockConnectorTableHandle in project trino by trinodb.

the class TestGrantOnTable method initClass.

@BeforeClass
public void initClass() throws Exception {
    queryRunner = DistributedQueryRunner.builder(admin).build();
    MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("default")).withListTables((session, schemaName) -> "default".equalsIgnoreCase(schemaName) ? ImmutableList.of(table) : ImmutableList.of()).withGetTableHandle((session, tableName) -> tableName.equals(table) ? new MockConnectorTableHandle(tableName) : null).withSchemaGrants(new MutableGrants<>()).withTableGrants(tableGrants).build();
    queryRunner.installPlugin(new MockConnectorPlugin(connectorFactory));
    queryRunner.createCatalog("local", "mock");
    assertions = new QueryAssertions(queryRunner);
    tableGrants.grant(new TrinoPrincipal(USER, "admin"), table, EnumSet.allOf(Privilege.class), true);
}
Also used : DataProvider(org.testng.annotations.DataProvider) USER(io.trino.spi.security.PrincipalType.USER) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.testng.annotations.Test) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ImmutableList(com.google.common.collect.ImmutableList) MockConnectorFactory(io.trino.connector.MockConnectorFactory) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Identity(io.trino.spi.security.Identity) Grants(io.trino.connector.Grants) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) Privilege(io.trino.spi.security.Privilege) EnumSet(java.util.EnumSet) AfterClass(org.testng.annotations.AfterClass) DataProviders(io.trino.testing.DataProviders) BeforeClass(org.testng.annotations.BeforeClass) SchemaTableName(io.trino.spi.connector.SchemaTableName) String.format(java.lang.String.format) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) TestingSession.testSessionBuilder(io.trino.testing.TestingSession.testSessionBuilder) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) Randoms.randomUsername(io.trino.common.Randoms.randomUsername) QueryAssertions(io.trino.sql.query.QueryAssertions) MutableGrants(io.trino.connector.MutableGrants) Session(io.trino.Session) MockConnectorFactory(io.trino.connector.MockConnectorFactory) QueryAssertions(io.trino.sql.query.QueryAssertions) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) Privilege(io.trino.spi.security.Privilege) BeforeClass(org.testng.annotations.BeforeClass)

Example 33 with MockConnectorTableHandle

use of io.trino.connector.MockConnectorTableHandle in project trino by trinodb.

the class TestDenyOnSchema method initClass.

@BeforeClass
public void initClass() throws Exception {
    queryRunner = DistributedQueryRunner.builder(admin).setAdditionalModule(binder -> {
        newOptionalBinder(binder, SystemSecurityMetadata.class).setBinding().toInstance(new DisabledSystemSecurityMetadata() {

            @Override
            public void denySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee) {
                assertThat(expectedSchemaName).isEqualTo(schemaName);
                assertThat(expectedPrivileges).isEqualTo(privileges);
                assertThat(expectedGrantee).isEqualTo(grantee);
                assertThat(denyCalled).isFalse();
                denyCalled = true;
            }
        });
    }).build();
    MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("default")).withListTables((session, schemaName) -> "default".equalsIgnoreCase(schemaName) ? ImmutableList.of(table) : ImmutableList.of()).withGetTableHandle((session, tableName) -> tableName.equals(table) ? new MockConnectorTableHandle(tableName) : null).build();
    queryRunner.installPlugin(new MockConnectorPlugin(connectorFactory));
    queryRunner.createCatalog("local", "mock");
    assertions = new QueryAssertions(queryRunner);
    tableGrants.grant(new TrinoPrincipal(USER, "admin"), table, EnumSet.allOf(Privilege.class), true);
}
Also used : SystemSecurityMetadata(io.trino.metadata.SystemSecurityMetadata) DataProvider(org.testng.annotations.DataProvider) USER(io.trino.spi.security.PrincipalType.USER) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.testng.annotations.Test) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ImmutableList(com.google.common.collect.ImmutableList) MockConnectorFactory(io.trino.connector.MockConnectorFactory) DisabledSystemSecurityMetadata(io.trino.metadata.DisabledSystemSecurityMetadata) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Identity(io.trino.spi.security.Identity) Grants(io.trino.connector.Grants) CatalogSchemaName(io.trino.spi.connector.CatalogSchemaName) ROOT(java.util.Locale.ROOT) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) Privilege(io.trino.spi.security.Privilege) EnumSet(java.util.EnumSet) OptionalBinder.newOptionalBinder(com.google.inject.multibindings.OptionalBinder.newOptionalBinder) AfterClass(org.testng.annotations.AfterClass) ImmutableSet(com.google.common.collect.ImmutableSet) BeforeClass(org.testng.annotations.BeforeClass) Set(java.util.Set) SchemaTableName(io.trino.spi.connector.SchemaTableName) String.format(java.lang.String.format) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) TestingSession.testSessionBuilder(io.trino.testing.TestingSession.testSessionBuilder) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) Randoms.randomUsername(io.trino.common.Randoms.randomUsername) QueryAssertions(io.trino.sql.query.QueryAssertions) MutableGrants(io.trino.connector.MutableGrants) Session(io.trino.Session) MockConnectorFactory(io.trino.connector.MockConnectorFactory) QueryAssertions(io.trino.sql.query.QueryAssertions) CatalogSchemaName(io.trino.spi.connector.CatalogSchemaName) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) DisabledSystemSecurityMetadata(io.trino.metadata.DisabledSystemSecurityMetadata) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) Privilege(io.trino.spi.security.Privilege) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) Session(io.trino.Session) BeforeClass(org.testng.annotations.BeforeClass)

Example 34 with MockConnectorTableHandle

use of io.trino.connector.MockConnectorTableHandle in project trino by trinodb.

the class TestDenyOnTable method initClass.

@BeforeClass
public void initClass() throws Exception {
    queryRunner = DistributedQueryRunner.builder(admin).setAdditionalModule(binder -> {
        newOptionalBinder(binder, SystemSecurityMetadata.class).setBinding().toInstance(new DisabledSystemSecurityMetadata() {

            @Override
            public void denyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee) {
                assertThat(expectedTableName).isEqualTo(tableName);
                assertThat(expectedPrivileges).isEqualTo(privileges);
                assertThat(expectedGrantee).isEqualTo(grantee);
                assertThat(denyCalled).isFalse();
                denyCalled = true;
            }
        });
    }).build();
    MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("default")).withListTables((session, schemaName) -> "default".equalsIgnoreCase(schemaName) ? ImmutableList.of(table) : ImmutableList.of()).withGetTableHandle((session, tableName) -> tableName.equals(table) ? new MockConnectorTableHandle(tableName) : null).build();
    queryRunner.installPlugin(new MockConnectorPlugin(connectorFactory));
    queryRunner.createCatalog("local", "mock");
    assertions = new QueryAssertions(queryRunner);
    tableGrants.grant(new TrinoPrincipal(USER, "admin"), table, EnumSet.allOf(Privilege.class), true);
}
Also used : SystemSecurityMetadata(io.trino.metadata.SystemSecurityMetadata) DataProvider(org.testng.annotations.DataProvider) USER(io.trino.spi.security.PrincipalType.USER) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.testng.annotations.Test) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ImmutableList(com.google.common.collect.ImmutableList) MockConnectorFactory(io.trino.connector.MockConnectorFactory) DisabledSystemSecurityMetadata(io.trino.metadata.DisabledSystemSecurityMetadata) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Identity(io.trino.spi.security.Identity) Grants(io.trino.connector.Grants) ROOT(java.util.Locale.ROOT) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) Privilege(io.trino.spi.security.Privilege) EnumSet(java.util.EnumSet) OptionalBinder.newOptionalBinder(com.google.inject.multibindings.OptionalBinder.newOptionalBinder) AfterClass(org.testng.annotations.AfterClass) ImmutableSet(com.google.common.collect.ImmutableSet) BeforeClass(org.testng.annotations.BeforeClass) Set(java.util.Set) SchemaTableName(io.trino.spi.connector.SchemaTableName) String.format(java.lang.String.format) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) TestingSession.testSessionBuilder(io.trino.testing.TestingSession.testSessionBuilder) QualifiedObjectName(io.trino.metadata.QualifiedObjectName) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) Randoms.randomUsername(io.trino.common.Randoms.randomUsername) QueryAssertions(io.trino.sql.query.QueryAssertions) MutableGrants(io.trino.connector.MutableGrants) Session(io.trino.Session) MockConnectorFactory(io.trino.connector.MockConnectorFactory) QueryAssertions(io.trino.sql.query.QueryAssertions) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) DisabledSystemSecurityMetadata(io.trino.metadata.DisabledSystemSecurityMetadata) TrinoPrincipal(io.trino.spi.security.TrinoPrincipal) Privilege(io.trino.spi.security.Privilege) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) QualifiedObjectName(io.trino.metadata.QualifiedObjectName) Session(io.trino.Session) BeforeClass(org.testng.annotations.BeforeClass)

Example 35 with MockConnectorTableHandle

use of io.trino.connector.MockConnectorTableHandle in project trino by trinodb.

the class TestMockConnector method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() throws Exception {
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().build()).build();
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.createCatalog("tpch", "tpch");
    queryRunner.installPlugin(new MockConnectorPlugin(MockConnectorFactory.builder().withListSchemaNames(connectionSession -> ImmutableList.of("default")).withGetColumns(schemaTableName -> {
        if (schemaTableName.equals(new SchemaTableName("default", "nation"))) {
            return TPCH_NATION_SCHEMA;
        }
        return ImmutableList.of(new ColumnMetadata("nationkey", BIGINT));
    }).withGetTableHandle((session, tableName) -> {
        if (tableName.equals(new SchemaTableName("default", "new_table"))) {
            return null;
        }
        return new MockConnectorTableHandle(tableName);
    }).withGetMaterializedViewProperties(() -> ImmutableList.of(durationProperty("refresh_interval", "Time interval after which materialized view will be refreshed", null, false))).withGetMaterializedViews((session, schemaTablePrefix) -> ImmutableMap.of(new SchemaTableName("default", "test_materialized_view"), new ConnectorMaterializedViewDefinition("SELECT nationkey FROM mock.default.test_table", Optional.of(new CatalogSchemaTableName("mock", "default", "test_storage")), Optional.of("mock"), Optional.of("default"), ImmutableList.of(new Column("nationkey", BIGINT.getTypeId())), Optional.empty(), Optional.of("alice"), ImmutableMap.of()))).withData(schemaTableName -> {
        if (schemaTableName.equals(new SchemaTableName("default", "nation"))) {
            return TPCH_NATION_DATA;
        }
        throw new UnsupportedOperationException();
    }).withProcedures(ImmutableSet.of(new TestProcedure().get())).withSchemaProperties(() -> ImmutableList.<PropertyMetadata<?>>builder().add(booleanProperty("boolean_schema_property", "description", false, false)).build()).withTableProperties(() -> ImmutableList.<PropertyMetadata<?>>builder().add(integerProperty("integer_table_property", "description", 0, false)).build()).build()));
    queryRunner.createCatalog("mock", "mock");
    return queryRunner;
}
Also used : ColumnMetadata(io.trino.spi.connector.ColumnMetadata) Test(org.testng.annotations.Test) Column(io.trino.spi.connector.ConnectorMaterializedViewDefinition.Column) PropertyMetadataUtil.durationProperty(io.trino.plugin.base.session.PropertyMetadataUtil.durationProperty) ConnectorMaterializedViewDefinition(io.trino.spi.connector.ConnectorMaterializedViewDefinition) AbstractTestQueryFramework(io.trino.testing.AbstractTestQueryFramework) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ImmutableList(com.google.common.collect.ImmutableList) MockConnectorFactory(io.trino.connector.MockConnectorFactory) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) TestProcedure(io.trino.procedure.TestProcedure) TpchPlugin(io.trino.plugin.tpch.TpchPlugin) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) TPCH_NATION_DATA(io.trino.connector.MockConnectorEntities.TPCH_NATION_DATA) PropertyMetadata.booleanProperty(io.trino.spi.session.PropertyMetadata.booleanProperty) PropertyMetadata(io.trino.spi.session.PropertyMetadata) TPCH_NATION_SCHEMA(io.trino.connector.MockConnectorEntities.TPCH_NATION_SCHEMA) SchemaTableName(io.trino.spi.connector.SchemaTableName) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) TestingSession.testSessionBuilder(io.trino.testing.TestingSession.testSessionBuilder) BIGINT(io.trino.spi.type.BigintType.BIGINT) CatalogSchemaTableName(io.trino.spi.connector.CatalogSchemaTableName) QueryRunner(io.trino.testing.QueryRunner) PropertyMetadata.integerProperty(io.trino.spi.session.PropertyMetadata.integerProperty) Optional(java.util.Optional) Session(io.trino.Session) DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) TestProcedure(io.trino.procedure.TestProcedure) TpchPlugin(io.trino.plugin.tpch.TpchPlugin) ConnectorMaterializedViewDefinition(io.trino.spi.connector.ConnectorMaterializedViewDefinition) MockConnectorPlugin(io.trino.connector.MockConnectorPlugin) SchemaTableName(io.trino.spi.connector.SchemaTableName) CatalogSchemaTableName(io.trino.spi.connector.CatalogSchemaTableName) CatalogSchemaTableName(io.trino.spi.connector.CatalogSchemaTableName) Column(io.trino.spi.connector.ConnectorMaterializedViewDefinition.Column) MockConnectorTableHandle(io.trino.connector.MockConnectorTableHandle) PropertyMetadata(io.trino.spi.session.PropertyMetadata)

Aggregations

MockConnectorTableHandle (io.trino.connector.MockConnectorTableHandle)35 Test (org.testng.annotations.Test)32 MockConnectorFactory (io.trino.connector.MockConnectorFactory)29 ImmutableList (com.google.common.collect.ImmutableList)25 SchemaTableName (io.trino.spi.connector.SchemaTableName)25 TestingSession.testSessionBuilder (io.trino.testing.TestingSession.testSessionBuilder)21 Session (io.trino.Session)20 ImmutableMap (com.google.common.collect.ImmutableMap)19 Optional (java.util.Optional)18 ColumnHandle (io.trino.spi.connector.ColumnHandle)17 ColumnMetadata (io.trino.spi.connector.ColumnMetadata)17 Symbol (io.trino.sql.planner.Symbol)16 BIGINT (io.trino.spi.type.BigintType.BIGINT)15 RuleTester (io.trino.sql.planner.iterative.rule.test.RuleTester)15 RuleTester.defaultRuleTester (io.trino.sql.planner.iterative.rule.test.RuleTester.defaultRuleTester)15 List (java.util.List)14 TableHandle (io.trino.metadata.TableHandle)13 TupleDomain (io.trino.spi.predicate.TupleDomain)12 PlanMatchPattern.tableScan (io.trino.sql.planner.assertions.PlanMatchPattern.tableScan)12 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)12