Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3115

Cannot add JdbcRules which have different JdbcConvention to same VolcanoPlanner's RuleSet.

    XMLWordPrintableJSON

Details

    Description

      When we use Calcite via JDBC to run a sql which involves two difference jdbc schema:

      select * from (select "a",max("b") as max_b, sum("c") as sum_c from "test"."temp" where "d" > 10 or "b" <> 'hello' group by "a", "e", "f" having "a" > 100 and max("b") < 20 limit 10) t  union select "a", "b","c" from "test2"."temp2" group by "a","b","c" 
      

      the sql get a plan like that:

      EnumerableUnion(all=[false])
        JdbcToEnumerableConverter
          JdbcProject(a=[$0], MAX_B=[$3], SUM_C=[$4])
            JdbcSort(fetch=[10])
              JdbcFilter(condition=[<(CAST($3):BIGINT, 20)])
                JdbcAggregate(group=[{0, 4, 5}], MAX_B=[MAX($1)], SUM_C=[SUM($2)])
                  JdbcFilter(condition=[AND(OR(>($3, 10), <>($1, 'hello')), >($0, 100))])
                    JdbcTableScan(table=[[test, temp]])
        EnumerableAggregate(group=[{0, 1, 2}])
          JdbcToEnumerableConverter
            JdbcTableScan(table=[[test2, temp2]])
      

      And the EnumerableAggregate for table test2.temp2 cannot be converted to JdbcAggregate.

      Attachments

        Issue Links

          Activity

            People

              ihuzenko Igor Guzenko
              winipanda TANG Wen-hui
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 40m
                  4h 40m