ziliangzeng opened a new issue #13404:
URL: https://github.com/apache/shardingsphere/issues/13404


   ## Bug Report
   - version
     5.0.0-beta
   - bug
   My database table names are all lowercase, and then when querying, the two 
table names of join use uppercase. There is an exception; I am a bit confused, 
isn't mysql case-insensitive? And there is no problem with the execution on 
navicate; when I set the table name to lowercase, the execution is successful.
   
   - sql
    `SELECT MAX(UPDATED_TIME) updateTime FROM PACKAGE_DOWNLOAD_LOG DOWN LEFT 
JOIN PACKAGE_ANALYSIS_INSERT_LOG ALY ON DOWN.ID=ALY.DOWNLOAD_ID  WHERE 
INFORM_ID=? AND LOG_TYPE=? ORDER BY UPDATED_TIME DESC `
   
   - exception
     `Caused by: java.sql.SQLException: Error while preparing statement [SELECT 
MAX(UPDATED_TIME) updateTime FROM PACKAGE_DOWNLOAD_LOG DOWN LEFT JOIN 
PACKAGE_ANALYSIS_INSERT_LOG ALY ON DOWN.ID=ALY.DOWNLOAD_ID  WHERE INFORM_ID=? 
AND LOG_TYPE=? ORDER BY UPDATED_TIME DESC]
        at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
        at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
        at 
org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:220)
        at 
org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:202)
        at 
org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:93)
        at 
org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:175)
        at 
org.apache.shardingsphere.infra.executor.sql.federate.execute.FederateJDBCExecutor.execute(FederateJDBCExecutor.java:105)
        at 
org.apache.shardingsphere.infra.executor.sql.federate.execute.FederateJDBCExecutor.executeQuery(FederateJDBCExecutor.java:84)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeFederatedQuery(ShardingSpherePreparedStatement.java:216)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery0(ShardingSpherePreparedStatement.java:202)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery(ShardingSpherePreparedStatement.java:179)
        at 
org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:678)
        at 
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617)
        ... 122 common frames omitted
   Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, 
column 180 to line 1, column 191: Expression 'UPDATED_TIME' is not being grouped
        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:422)
        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.AggChecker.visit(AggChecker.java:113)
        at org.apache.calcite.sql.validate.AggChecker.visit(AggChecker.java:40)
        at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:320)
        at 
org.apache.calcite.sql.validate.AggregatingSelectScope.checkAggregateExpr(AggregatingSelectScope.java:209)
        at 
org.apache.calcite.sql.validate.AggregatingSelectScope.validateExpr(AggregatingSelectScope.java:218)
        at 
org.apache.calcite.sql.validate.OrderByScope.validateExpr(OrderByScope.java:125)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateExpr(SqlValidatorImpl.java:4263)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateOrderItem(SqlValidatorImpl.java:4013)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateOrderItem(SqlValidatorImpl.java:4007)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateOrderList(SqlValidatorImpl.java:3964)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3480)
        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)
        ... 132 common frames omitted
   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Expression 
'UPDATED_TIME' is not being grouped
        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:422)
        at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
        at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:560)
        ... 161 common frames omitted`
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to