當前位置: 首頁>>代碼示例>>Java>>正文


Java SubQueryRemoveRule類代碼示例

本文整理匯總了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();
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:17,代碼來源:RelOptRulesTest.java

示例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();
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:17,代碼來源:RelOptRulesTest.java

示例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();
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:17,代碼來源:RelOptRulesTest.java

示例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);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:8,代碼來源:Programs.java

示例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);
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:9,代碼來源:RelOptRulesTest.java

示例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);
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:7,代碼來源:Programs.java


注:本文中的org.apache.calcite.rel.rules.SubQueryRemoveRule類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。