Search in sources :

Example 1 with CONNECTOR_ID

use of io.trino.sql.planner.iterative.rule.test.RuleTester.CONNECTOR_ID in project trino by trinodb.

the class TestRemoveEmptyDeleteRuleSet method testDoesNotFire.

@Test(dataProvider = "rules")
public void testDoesNotFire(Rule<?> rule) {
    tester().assertThat(rule).on(p -> p.tableDelete(new SchemaTableName("sch", "tab"), p.tableScan(new TableHandle(CONNECTOR_ID, new TpchTableHandle("sf1", "nation", 1.0), TpchTransactionHandle.INSTANCE), ImmutableList.of(), ImmutableMap.of()), p.symbol("a", BigintType.BIGINT))).doesNotFire();
    tester().assertThat(rule).on(p -> p.tableWithExchangeDelete(new SchemaTableName("sch", "tab"), p.tableScan(new TableHandle(CONNECTOR_ID, new TpchTableHandle("sf1", "nation", 1.0), TpchTransactionHandle.INSTANCE), ImmutableList.of(), ImmutableMap.of()), p.symbol("a", BigintType.BIGINT))).doesNotFire();
}
Also used : DataProvider(org.testng.annotations.DataProvider) ImmutableMap(com.google.common.collect.ImmutableMap) BaseRuleTest(io.trino.sql.planner.iterative.rule.test.BaseRuleTest) CONNECTOR_ID(io.trino.sql.planner.iterative.rule.test.RuleTester.CONNECTOR_ID) PlanMatchPattern(io.trino.sql.planner.assertions.PlanMatchPattern) Test(org.testng.annotations.Test) SchemaTableName(io.trino.spi.connector.SchemaTableName) RemoveEmptyDeleteRuleSet.removeEmptyDeleteWithExchangeRule(io.trino.sql.planner.iterative.rule.RemoveEmptyDeleteRuleSet.removeEmptyDeleteWithExchangeRule) TpchTransactionHandle(io.trino.plugin.tpch.TpchTransactionHandle) BigintType(io.trino.spi.type.BigintType) TableHandle(io.trino.metadata.TableHandle) DataProviders.toDataProvider(io.trino.testing.DataProviders.toDataProvider) ImmutableList(com.google.common.collect.ImmutableList) TpchTableHandle(io.trino.plugin.tpch.TpchTableHandle) Rule(io.trino.sql.planner.iterative.Rule) RemoveEmptyDeleteRuleSet.remoteEmptyDeleteRule(io.trino.sql.planner.iterative.rule.RemoveEmptyDeleteRuleSet.remoteEmptyDeleteRule) TableHandle(io.trino.metadata.TableHandle) TpchTableHandle(io.trino.plugin.tpch.TpchTableHandle) SchemaTableName(io.trino.spi.connector.SchemaTableName) TpchTableHandle(io.trino.plugin.tpch.TpchTableHandle) BaseRuleTest(io.trino.sql.planner.iterative.rule.test.BaseRuleTest) Test(org.testng.annotations.Test)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 TableHandle (io.trino.metadata.TableHandle)1 TpchTableHandle (io.trino.plugin.tpch.TpchTableHandle)1 TpchTransactionHandle (io.trino.plugin.tpch.TpchTransactionHandle)1 SchemaTableName (io.trino.spi.connector.SchemaTableName)1 BigintType (io.trino.spi.type.BigintType)1 PlanMatchPattern (io.trino.sql.planner.assertions.PlanMatchPattern)1 Rule (io.trino.sql.planner.iterative.Rule)1 RemoveEmptyDeleteRuleSet.remoteEmptyDeleteRule (io.trino.sql.planner.iterative.rule.RemoveEmptyDeleteRuleSet.remoteEmptyDeleteRule)1 RemoveEmptyDeleteRuleSet.removeEmptyDeleteWithExchangeRule (io.trino.sql.planner.iterative.rule.RemoveEmptyDeleteRuleSet.removeEmptyDeleteWithExchangeRule)1 BaseRuleTest (io.trino.sql.planner.iterative.rule.test.BaseRuleTest)1 CONNECTOR_ID (io.trino.sql.planner.iterative.rule.test.RuleTester.CONNECTOR_ID)1 DataProviders.toDataProvider (io.trino.testing.DataProviders.toDataProvider)1 DataProvider (org.testng.annotations.DataProvider)1 Test (org.testng.annotations.Test)1