You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/10 08:00:38 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue #11741: Federate executor engine does not support dialect database function

strongduanmu opened a new issue #11741:
URL: https://github.com/apache/shardingsphere/issues/11741


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Execute sql success. Following is the sql, `t_order` is a sharding table.
   ```sql
   SELECT order_id, CONCAT('sum:', sum(cnt)) FROM (
   	SELECT order_id, user_id, COUNT(1) AS cnt FROM t_order GROUP BY order_id, user_id
   ) a GROUP BY order_id;
   ```
   
   ### Actual behavior
   
   ```
   ERROR 1815 (HY000): Internal error: Error while preparing statement [SELECT order_id, CONCAT('sum:', sum(cnt)) FROM (     SELECT order_id, user_id, COUNT(1) AS cnt FROM t_order GROUP BY order_id, user_id ) a GROUP BY order_id]
   
   Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 18 to line 1, column 41: No match found for function signature CONCAT(<CHARACTER>, <NUMERIC>)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
   	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:883)
   	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:868)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5043)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.handleUnresolvedFunction(SqlValidatorImpl.java:1838)
   	at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:321)
   	at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:226)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5882)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5869)
   	at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:139)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1756)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1741)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem(SqlValidatorImpl.java:440)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4205)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3474)
   	at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
   	at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1067)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1041)
   	at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1016)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:724)
   	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:567)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:242)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:208)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:642)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:508)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:478)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:231)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:213)
   	... 18 common frames omitted
   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match found for function signature CONCAT(<CHARACTER>, <NUMERIC>)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
   	at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:560)
   	... 47 common frames omitted
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #11741: Federate executor engine does not support dialect database function

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #11741:
URL: https://github.com/apache/shardingsphere/issues/11741#issuecomment-895819670


   According to the [official documentation](https://calcite.apache.org/docs/reference.html#dialect-specific-operators), the `CONCAT` function is a dialect operation and is not included in standard SQL. We need to enable the fun parameter to support this operation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #11741: Federate executor engine does not support dialect database function

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #11741:
URL: https://github.com/apache/shardingsphere/issues/11741


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org