use of org.apache.calcite.rel.rules.ProjectCorrelateTransposeRule in project calcite by apache.
the class RelOptRulesTest method testProjectCorrelateTransposeDynamic.
@Test
void testProjectCorrelateTransposeDynamic() {
ProjectCorrelateTransposeRule customPCTrans = ProjectCorrelateTransposeRule.Config.DEFAULT.withPreserveExprCondition(RelOptRulesTest::skipItem).toRule();
String sql = "select t1.c_nationkey, t2.a as fake_col2 " + "from SALES.CUSTOMER as t1, " + "unnest(t1.fake_col) as t2(a)";
sql(sql).withDynamicTable().withRule(customPCTrans).checkUnchanged();
}
use of org.apache.calcite.rel.rules.ProjectCorrelateTransposeRule in project calcite by apache.
the class RelOptRulesTest method testProjectCorrelateTranspose.
@Test
void testProjectCorrelateTranspose() {
ProjectCorrelateTransposeRule customPCTrans = ProjectCorrelateTransposeRule.Config.DEFAULT.withPreserveExprCondition(expr -> true).toRule();
final String sql = "select t1.name, t2.ename\n" + "from DEPT_NESTED as t1,\n" + "unnest(t1.employees) as t2";
sql(sql).withRule(customPCTrans).check();
}
use of org.apache.calcite.rel.rules.ProjectCorrelateTransposeRule in project calcite by apache.
the class RelOptRulesTest method testProjectCorrelateTransposeWithExprCond.
@Test
void testProjectCorrelateTransposeWithExprCond() {
ProjectCorrelateTransposeRule customPCTrans = ProjectCorrelateTransposeRule.Config.DEFAULT.withPreserveExprCondition(RelOptRulesTest::skipItem).toRule();
final String sql = "select t1.name, t2.ename\n" + "from DEPT_NESTED as t1,\n" + "unnest(t1.employees) as t2";
sql(sql).withRule(customPCTrans).check();
}
Aggregations