Search in sources :

Example 1 with ProjectJoinTransposeRule

use of org.apache.calcite.rel.rules.ProjectJoinTransposeRule in project calcite by apache.

the class RelOptRulesTest method testProjectJoinTransposeItem.

@Test
void testProjectJoinTransposeItem() {
    ProjectJoinTransposeRule projectJoinTransposeRule = CoreRules.PROJECT_JOIN_TRANSPOSE.config.withOperandFor(Project.class, Join.class).withPreserveExprCondition(RelOptRulesTest::skipItem).toRule();
    final String sql = "select t1.c_nationkey[0], t2.c_nationkey[0]\n" + "from sales.customer as t1\n" + "left outer join sales.customer as t2\n" + "on t1.c_nationkey[0] = t2.c_nationkey[0]";
    sql(sql).withDynamicTable().withRule(projectJoinTransposeRule).check();
}
Also used : ProjectJoinTransposeRule(org.apache.calcite.rel.rules.ProjectJoinTransposeRule) Test(org.junit.jupiter.api.Test)

Aggregations

ProjectJoinTransposeRule (org.apache.calcite.rel.rules.ProjectJoinTransposeRule)1 Test (org.junit.jupiter.api.Test)1