[ 
https://issues.apache.org/jira/browse/CALCITE-2010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jin Xing updated CALCITE-2010:
------------------------------
    Attachment: graphviz (1).svg

> Cannot plan query that is UNION ALL applied to VALUES
> -----------------------------------------------------
>
>                 Key: CALCITE-2010
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2010
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>         Attachments: graphviz (1).svg
>
>
> Cannot plan query that is UNION ALL applied to VALUES. For example, in 
> JdbcTest:
> {code}
>   @Test public void testUnionAllValues() {
>     CalciteAssert.hr()
>         .query("select x, y from (values (1, 2)) as t(x, y)\n"
>             + "union all\n"
>             + "select a + b, a - b from (values (3, 4), (5, 6)) as u(a, b)")
>         .returnsUnordered();
>   }
> {code}
> gives
> {noformat}
> java.sql.SQLException: Error while executing SQL "select x, y from (values 
> (1, 2)) as t(x, y)
> union all
> select a + b, a - b from (values (3, 4), (5, 6)) as u(a, b)": Node 
> [rel#26:Subset#4.ENUMERABLE.[]] could not be implemented; planner state:
> Root: rel#26:Subset#4.ENUMERABLE.[]
> Original rel:
> LogicalUnion(subset=[rel#26:Subset#4.ENUMERABLE.[]], all=[true]): rowcount = 
> 3.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 21
>   LogicalProject(subset=[rel#17:Subset#1.NONE.[]], X=[$0], Y=[$1]): rowcount 
> = 1.0, cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io}, id = 16
>     LogicalValues(subset=[rel#15:Subset#0.NONE.[]], tuples=[[{ 1, 2 }]]): 
> rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 1
>   LogicalProject(subset=[rel#20:Subset#3.NONE.[0]], EXPR$0=[+($0, $1)], 
> EXPR$1=[-($0, $1)]): rowcount = 2.0, cumulative cost = {2.0 rows, 4.0 cpu, 
> 0.0 io}, id = 19
>     LogicalValues(subset=[rel#18:Subset#2.NONE.[]], tuples=[[{ 3, 4 }, { 5, 6 
> }]]): rowcount = 2.0, cumulative cost = {2.0 rows, 1.0 cpu, 0.0 io}, id = 4
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to