You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "TANG Wen-hui (JIRA)" <ji...@apache.org> on 2019/06/06 09:20:00 UTC
[jira] [Updated] (CALCITE-3115) Cannot add JdbcRules which have
different JdbcConvention to same VolcanoPlanner's RuleSet.
[ https://issues.apache.org/jira/browse/CALCITE-3115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
TANG Wen-hui updated CALCITE-3115:
----------------------------------
Description:
When we use Calcite via JDBC to run a sql which involves two difference jdbc schema:
{code:java}
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"
{code}
the sql get a plan like that:
{code:java}
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]])
{code}
And the EnumerableAggregate for table test2.temp2 cannot be converted to JdbcAggregate.
was:
When we use Calcite via JDBC to run a sql which involves two difference jdbc schema:
{code:java}
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"
{code}
the sql get a plan like that:
{code:java}
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]])
{code}
And the EnumerableAggregate for table test2.temp2 cannot be convert to JdbcAggregate.
> Cannot add JdbcRules which have different JdbcConvention to same VolcanoPlanner's RuleSet.
> ------------------------------------------------------------------------------------------
>
> Key: CALCITE-3115
> URL: https://issues.apache.org/jira/browse/CALCITE-3115
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.19.0
> Reporter: TANG Wen-hui
> Assignee: TANG Wen-hui
> Priority: Major
>
> When we use Calcite via JDBC to run a sql which involves two difference jdbc schema:
> {code:java}
> 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"
> {code}
> the sql get a plan like that:
> {code:java}
> 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]])
> {code}
> And the EnumerableAggregate for table test2.temp2 cannot be converted to JdbcAggregate.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)