本文整理匯總了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);
}