[jira] [Created] (CALCITE-1388) Error during RelNode to sql conversion
Viktor Batytskyi created CALCITE-1388: - Summary: Error during RelNode to sql conversion Key: CALCITE-1388 URL: https://issues.apache.org/jira/browse/CALCITE-1388 Project: Calcite Issue Type: Bug Components: core Environment: Oracle JDK 1.8 Reporter: Viktor Batytskyi Assignee: Julian Hyde The following query contains ROLLUP operator in GROUP BY clause. ``` SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) ``` After the string sql is parsed and validated by executing: ``` val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() ``` The resulting relExpression can't be transformed back to a query: private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql The exception is thrown: ``` Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted ``` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code:scala} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code:scala} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} was: The following query contains ROLLUP operator in GROUP BY clause. ``` SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) ``` After the string sql is parsed and validated by executing: ``` val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() ``` The resulting relExpression can't be transformed back to a query: private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql The exception is thrown: ``` Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code:scala} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code:scala} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80)
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80)
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Summary: Error during RelNode to sql string conversion (was: Error during RelNode to sql conversion) > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relNode).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relNode).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSq
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} The failure can be tested by (RelToSqlConverterTest): {code:java} @Test public void testSimpleRollup() { String query = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; String expected = "select product_id\n" + "from product\n" + "group by rollup((product_id))"; sql(query).ok(expected); } {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} The failure can be tested by (RelToSqlConverterTest): {code:java} @Test public void testSimpleRollup() { String query = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; String expected = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; } {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While inv
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} The failure can be tested by (RelToSqlConverterTest of Calcite Core project): {code:java} @Test public void testSimpleRollup() { String query = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; String expected = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; sql(query).ok(expected); } {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Description: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.Util.newInternal(Util.java:792) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) ... 34 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 37 common frames omitted Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) at org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) ... 42 common frames omitted {code} The failure can be tested by (RelToSqlConverterTest): {code:java} @Test public void testSimpleRollup() { String query = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; String expected = "select \"product_id\"\n" + "from \"product\"\n" + "group by rollup((\"product_id\"))"; sql(query).ok(expected); } {code} was: The following query contains ROLLUP operator in GROUP BY clause. {code:sql} SELECT player_id, video_id, SUM(clicks) FROM Table GROUP BY ROLLUP((player_id, video_id)) {code} After the sql string is parsed and validated by executing: {code} val planner = Frameworks.getPlanner(config) val sqlNode = planner.parse(mockedSql) val validatedSql = planner.validate(sqlNode) val relExpression = planner.rel(validatedSql).project() {code} The resulting relExpression can't be transformed back to a query: {code} private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect . val sql = new RelToSqlConverter(VERTICA).visitChild(0, relExpression).asQuery.toSqlString(VERTICA).getSql {code} The exception is thrown: {code} Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ... 29 common frames omitted Caused by: java.lang.AssertionErr
[jira] [Updated] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi updated CALCITE-1388: -- Fix Version/s: next > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > Fix For: next > > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526555#comment-15526555 ] Viktor Batytskyi commented on CALCITE-1388: --- I suppose that the issue is worth fixing in a next release, as rollup() operator is not usable at all. :) Yep, I'm trying to come up with a patch. > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Reopened] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi reopened CALCITE-1388: --- > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Closed] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viktor Batytskyi closed CALCITE-1388. - Resolution: Fixed > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15554996#comment-15554996 ] Viktor Batytskyi commented on CALCITE-1388: --- Consequent issues while transforming RelNode to SQL has arisen. Re-opening issue, as for now it will take too much time to resolve. > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (CALCITE-1388) Error during RelNode to sql string conversion
[ https://issues.apache.org/jira/browse/CALCITE-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15554996#comment-15554996 ] Viktor Batytskyi edited comment on CALCITE-1388 at 10/7/16 12:44 PM: - Consequent issues while transforming RelNode to SQL have arisen. Reopening the issue, as it will take too much time to resolve. was (Author: victor.ba...@gmail.com): Consequent issues while transforming RelNode to SQL has arisen. Re-opening issue, as for now it will take too much time to resolve. > Error during RelNode to sql string conversion > - > > Key: CALCITE-1388 > URL: https://issues.apache.org/jira/browse/CALCITE-1388 > Project: Calcite > Issue Type: Bug > Components: core > Environment: Oracle JDK 1.8 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > > The following query contains ROLLUP operator in GROUP BY clause. > {code:sql} > SELECT player_id, video_id, SUM(clicks) > FROM Table > GROUP BY ROLLUP((player_id, video_id)) > {code} > After the sql string is parsed and validated by executing: > {code} > val planner = Frameworks.getPlanner(config) > val sqlNode = planner.parse(mockedSql) > val validatedSql = planner.validate(sqlNode) > val relExpression = planner.rel(validatedSql).project() > {code} > The resulting relExpression can't be transformed back to a query: > {code} > private val VERTICA = SqlDialect.DatabaseProduct.VERTICA.getDialect > . > val sql = new RelToSqlConverter(VERTICA).visitChild(0, > relExpression).asQuery.toSqlString(VERTICA).getSql > {code} > The exception is thrown: > {code} > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 29 common frames omitted > Caused by: java.lang.AssertionError: Internal error: While invoking method > 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.Util.newInternal(Util.java:792) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:80) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:84) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:125) > ... 34 common frames omitted > Caused by: java.lang.reflect.InvocationTargetException: null > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) > ... 37 common frames omitted > Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.rangeCheck(ArrayList.java:653) > at java.util.ArrayList.get(ArrayList.java:429) > at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:93) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Result$1.field(SqlImplementor.java:781) > at > org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:450) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:133) > ... 42 common frames omitted > {code} > The failure can be tested by (RelToSqlConverterTest of Calcite Core project): > {code:java} > @Test public void testSimpleRollup() { > String query = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > String expected = "select \"product_id\"\n" + > "from \"product\"\n" + > "group by rollup((\"product_id\"))"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (CALCITE-1422) Add support of IS NULL and IS NOT NULL operators to a join condition clause
Viktor Batytskyi created CALCITE-1422: - Summary: Add support of IS NULL and IS NOT NULL operators to a join condition clause Key: CALCITE-1422 URL: https://issues.apache.org/jira/browse/CALCITE-1422 Project: Calcite Issue Type: Improvement Components: core Reporter: Viktor Batytskyi Assignee: Julian Hyde Fix For: 1.9.0 Currently, Calcite doesn't support IS NULL and IS NOT NULL operators in ON condition clause of a JOIN operator. These operators may be useful if a query needs to join on both keys being null. Test which proves the failure of (RelToSqlConverterTest.java): {code} @Test public void testSimpleJoinConditionWithIsNullOperators() { String query = "select *\n" + "from \"foodmart\".\"sales_fact_1997\" as \"t1\"\n" + "inner join \"foodmart\".\"customer\" as \"t2\"\n" + "on \"t1\".\"customer_id\" = \"t2\".\"customer_id\" or " + "(\"t1\".\"customer_id\" is null " + "and \"t2\".\"customer_id\" is null)\n" + "inner join \"foodmart\".\"product\" as \"t3\"\n" + "on \"t1\".\"product_id\" = \"t3\".\"product_id\" or " + "(\"t1\".\"product_id\" is not null or " + "\"t3\".\"product_id\" is not null)"; System.out.println(query); String expected = "SELECT *\nFROM \"foodmart\".\"sales_fact_1997\"\n" + "INNER JOIN \"foodmart\".\"customer\" " + "ON \"sales_fact_1997\".\"customer_id\" = \"customer\".\"customer_id\"" + " OR \"sales_fact_1997\".\"customer_id\" IS NULL " + "AND \"customer\".\"customer_id\" IS NULL\n" + "INNER JOIN \"foodmart\".\"product\" " + "ON \"sales_fact_1997\".\"product_id\" = \"product\".\"product_id\" OR " + "\"sales_fact_1997\".\"product_id\" IS NOT NULL " + "OR \"product\".\"product_id\" IS NOT NULL"; sql(query).ok(expected); } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CALCITE-1422) Add support of IS NULL and IS NOT NULL operators to a join condition clause
[ https://issues.apache.org/jira/browse/CALCITE-1422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1079#comment-1079 ] Viktor Batytskyi commented on CALCITE-1422: --- Please take a look at: https://github.com/apache/calcite/pull/300 > Add support of IS NULL and IS NOT NULL operators to a join condition clause > --- > > Key: CALCITE-1422 > URL: https://issues.apache.org/jira/browse/CALCITE-1422 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > Fix For: 1.9.0 > > > Currently, Calcite doesn't support IS NULL and IS NOT NULL operators in ON > condition clause of a JOIN operator. These operators may be useful if a query > needs to join on both keys being null. > Test which proves the failure of (RelToSqlConverterTest.java): > {code} > @Test > public void testSimpleJoinConditionWithIsNullOperators() { > String query = "select *\n" > + "from \"foodmart\".\"sales_fact_1997\" as \"t1\"\n" > + "inner join \"foodmart\".\"customer\" as \"t2\"\n" > + "on \"t1\".\"customer_id\" = \"t2\".\"customer_id\" or " > + "(\"t1\".\"customer_id\" is null " > + "and \"t2\".\"customer_id\" is null)\n" > + "inner join \"foodmart\".\"product\" as \"t3\"\n" > + "on \"t1\".\"product_id\" = \"t3\".\"product_id\" or " > + "(\"t1\".\"product_id\" is not null or " + > "\"t3\".\"product_id\" is not null)"; > System.out.println(query); > String expected = "SELECT *\nFROM \"foodmart\".\"sales_fact_1997\"\n" > + "INNER JOIN \"foodmart\".\"customer\" " > + "ON \"sales_fact_1997\".\"customer_id\" = > \"customer\".\"customer_id\"" > + " OR \"sales_fact_1997\".\"customer_id\" IS NULL " > + "AND \"customer\".\"customer_id\" IS NULL\n" > + "INNER JOIN \"foodmart\".\"product\" " > + "ON \"sales_fact_1997\".\"product_id\" = \"product\".\"product_id\" > OR " > + "\"sales_fact_1997\".\"product_id\" IS NOT NULL " > + "OR \"product\".\"product_id\" IS NOT NULL"; > sql(query).ok(expected); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (CALCITE-1800) JDBC adapter fails to SELECT FROM a UNION query
Viktor Batytskyi created CALCITE-1800: - Summary: JDBC adapter fails to SELECT FROM a UNION query Key: CALCITE-1800 URL: https://issues.apache.org/jira/browse/CALCITE-1800 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.13.0 Reporter: Viktor Batytskyi Assignee: Julian Hyde Fix For: 1.12.0 Relational representation of the following query fails to be converter to sql string in Calcite: {code} select sum(case when "product_id"=0 then "net_weight" else 0 end) as net_weight from ( select "product_id", "net_weight" from "product" union all select "product_id", 0 as "net_weight" from "sales_fact_1997" ) t0 {code} The conversion fails with: {code} java.lang.RuntimeException: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Aggregate)' at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:528) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:96) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:100) at org.apache.calcite.rel.rel2sql.RelToSqlConverterTest$Sql.ok(RelToSqlConverterTest.java:1559) at org.apache.calcite.rel.rel2sql.RelToSqlConverterTest.testUnionWrappedInASelect(RelToSqlConverterTest.java:654) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:525) ... 31 more Caused by: java.lang.RuntimeException: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:528) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:96) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:100) at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:179) ... 36 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke
[jira] [Commented] (CALCITE-1800) JDBC adapter fails to SELECT FROM a UNION query
[ https://issues.apache.org/jira/browse/CALCITE-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019782#comment-16019782 ] Viktor Batytskyi commented on CALCITE-1800: --- [~julianhyde] Please take a look: https://github.com/apache/calcite/pull/454 > JDBC adapter fails to SELECT FROM a UNION query > > > Key: CALCITE-1800 > URL: https://issues.apache.org/jira/browse/CALCITE-1800 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.13.0 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > Fix For: 1.12.0 > > Original Estimate: 2h > Remaining Estimate: 2h > > Relational representation of the following query fails to be converter to sql > string in Calcite: > {code} > select sum(case when "product_id"=0 then "net_weight" else 0 end) as > net_weight > from ( select "product_id", "net_weight" from "product" > union all > select "product_id", 0 as "net_weight" from "sales_fact_1997" ) t0 > {code} > The conversion fails with: > {code} > java.lang.RuntimeException: While invoking method 'public > org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Aggregate)' > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:528) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:96) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:100) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverterTest$Sql.ok(RelToSqlConverterTest.java:1559) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverterTest.testUnionWrappedInASelect(RelToSqlConverterTest.java:654) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:525) > ... 31 more > Caused by: java.lang.RuntimeException: While invoking method 'public > org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Project)' > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUti
[jira] [Commented] (CALCITE-1800) JDBC adapter fails to SELECT FROM a UNION query
[ https://issues.apache.org/jira/browse/CALCITE-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16020782#comment-16020782 ] Viktor Batytskyi commented on CALCITE-1800: --- [~minjikim] [~julianhyde] The improvement seems reasonable, additional checks won't hurt. Applied them: https://github.com/apache/calcite/pull/454 Thank you, [~minjikim] and [~julianhyde]! > JDBC adapter fails to SELECT FROM a UNION query > > > Key: CALCITE-1800 > URL: https://issues.apache.org/jira/browse/CALCITE-1800 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.9.0 >Reporter: Viktor Batytskyi >Assignee: Julian Hyde > Fix For: 1.13.0 > > Original Estimate: 2h > Remaining Estimate: 2h > > Relational representation of the following query fails to be converter to sql > string in Calcite: > {code} > select sum(case when "product_id"=0 then "net_weight" else 0 end) as > net_weight > from ( select "product_id", "net_weight" from "product" > union all > select "product_id", 0 as "net_weight" from "sales_fact_1997" ) t0 > {code} > The conversion fails with: > {code} > java.lang.RuntimeException: While invoking method 'public > org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(org.apache.calcite.rel.core.Aggregate)' > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:528) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:96) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(RelToSqlConverter.java:100) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverterTest$Sql.ok(RelToSqlConverterTest.java:1559) > at > org.apache.calcite.rel.rel2sql.RelToSqlConverterTest.testUnionWrappedInASelect(RelToSqlConverterTest.java:654) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at > com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) > at > com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:525) > ... 31 more > Caused by: java.lang.RuntimeException: While invoking method 'public > org.apache.calcite.rel.rel2sql.SqlImplementor$Result > org.apache.calcite.rel.rel2sql.RelToSqlConverte