本文整理汇总了Java中org.apache.calcite.rel.rules.SubQueryRemoveRule类的典型用法代码示例。如果您正苦于以下问题:Java SubQueryRemoveRule类的具体用法?Java SubQueryRemoveRule怎么用?Java SubQueryRemoveRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SubQueryRemoveRule类属于org.apache.calcite.rel.rules包,在下文中一共展示了SubQueryRemoveRule类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCustomColumnResolvingInNonCorrelatedSubQuery
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
@Test public void testCustomColumnResolvingInNonCorrelatedSubQuery() {
final String sql = "select *\n"
+ "from struct.t t1\n"
+ "where c0 in (\n"
+ " select f1.c0 from struct.t t2)";
final HepProgram program = new HepProgramBuilder()
.addRuleInstance(SubQueryRemoveRule.PROJECT)
.addRuleInstance(SubQueryRemoveRule.FILTER)
.addRuleInstance(SubQueryRemoveRule.JOIN)
.build();
sql(sql)
.withTrim(true)
.expand(false)
.with(program)
.check();
}
示例2: testCustomColumnResolvingInCorrelatedSubQuery
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
@Test public void testCustomColumnResolvingInCorrelatedSubQuery() {
final String sql = "select *\n"
+ "from struct.t t1\n"
+ "where c0 = (\n"
+ " select max(f1.c0) from struct.t t2 where t1.k0 = t2.k0)";
final HepProgram program = new HepProgramBuilder()
.addRuleInstance(SubQueryRemoveRule.PROJECT)
.addRuleInstance(SubQueryRemoveRule.FILTER)
.addRuleInstance(SubQueryRemoveRule.JOIN)
.build();
sql(sql)
.withTrim(true)
.expand(false)
.with(program)
.check();
}
示例3: testCustomColumnResolvingInCorrelatedSubQuery2
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
@Test public void testCustomColumnResolvingInCorrelatedSubQuery2() {
final String sql = "select *\n"
+ "from struct.t t1\n"
+ "where c0 in (\n"
+ " select f1.c0 from struct.t t2 where t1.c2 = t2.c2)";
final HepProgram program = new HepProgramBuilder()
.addRuleInstance(SubQueryRemoveRule.PROJECT)
.addRuleInstance(SubQueryRemoveRule.FILTER)
.addRuleInstance(SubQueryRemoveRule.JOIN)
.build();
sql(sql)
.withTrim(true)
.expand(false)
.with(program)
.check();
}
示例4: subQuery
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
public static Program subQuery(RelMetadataProvider metadataProvider) {
return hep(
ImmutableList.of((RelOptRule) SubQueryRemoveRule.FILTER,
SubQueryRemoveRule.PROJECT,
SubQueryRemoveRule.JOIN, OLAPJoinPushThroughJoinRule.INSTANCE,
OLAPJoinPushThroughJoinRule2.INSTANCE), true, metadataProvider);
}
示例5: checkSubQuery
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
private Sql checkSubQuery(String sql) {
final HepProgram program = new HepProgramBuilder()
.addRuleInstance(SubQueryRemoveRule.PROJECT)
.addRuleInstance(SubQueryRemoveRule.FILTER)
.addRuleInstance(SubQueryRemoveRule.JOIN)
.build();
return sql(sql).with(new HepPlanner(program)).expand(false);
}
示例6: subQuery
import org.apache.calcite.rel.rules.SubQueryRemoveRule; //导入依赖的package包/类
public static Program subQuery(RelMetadataProvider metadataProvider) {
return hep(
ImmutableList.of((RelOptRule) SubQueryRemoveRule.FILTER,
SubQueryRemoveRule.PROJECT,
SubQueryRemoveRule.JOIN), true, metadataProvider);
}