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/06/18 20:55:06 UTC

[GitHub] [shardingsphere] ysyysjbama opened a new issue #10861: Double quote is removed when using AVG aggregation function

ysyysjbama opened a new issue #10861:
URL: https://github.com/apache/shardingsphere/issues/10861


   ## Bug Report
   * Sharding-JDBC version:  4.1.1 
   * database : PostgreSQL
     In my database , table column is  **uppercase**,  because PostgreSQL is case sensitive,I have to use **double quote** in the sql query column . It is OK until I use AVG aggregation function in my query statement.
   The original SQL :
   ```SELECT 
   	AVG ( A."DIRECTION" )
   FROM
   	b_flow_vihicle_link AS A 
   	LEFT JOIN b_flow_vihicle_travel b ON A."VIHICLE_TRAVEL_ID" = b."ID"
   	LEFT JOIN t_vihicle_info C ON b."VIHICLE_ID" = C."ID" 
   ```
   
   the rewrited SQL (Sharding-JDBC ):
   ```
   SELECT 
   	AVG ( A."DIRECTION" ),
   	COUNT ( A.DIRECTION ) AS AVG_DERIVED_COUNT_0,
   	SUM ( A.DIRECTION ) AS AVG_DERIVED_SUM_0 
   FROM
   	b_flow_vihicle_link_34 AS A 
   	LEFT JOIN b_flow_vihicle_travel_34 b ON A."VIHICLE_TRAVEL_ID" = b."ID"
   	LEFT JOIN t_vihicle_info C ON b."VIHICLE_ID" = C."ID" 
   ```
   In the rewrited SQL , COUNT ( A.DIRECTION ) and SUM ( A.DIRECTION ) are generated by Sharding-JDBC , but the double quote of A.DIRECTION is removed , so I get the exection like this : org.postgresql.util.PSQLException: ERROR: column A.direction does not exist.
   
   ## Reason analyze (If you can)
   I found the code in the class **org.apache.shardingsphere.sql.parser.sql.util.SQLUtil** where the double quote is removed ,but I don‘t know why it should be removed. 
   thank you !
   


-- 
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.

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



[GitHub] [shardingsphere] tristaZero closed issue #10861: Double quote is removed when using AVG aggregation function

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


   


-- 
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 #10861: Double quote is removed when using AVG aggregation function

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


   > @ysyysjbama @strongduanmu
   > any progress? I want to work for this issue if nothing has started
   
   @iamkyu Welcome, i will assign this issue to you.


-- 
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] iamkyu edited a comment on issue #10861: Double quote is removed when using AVG aggregation function

Posted by GitBox <gi...@apache.org>.
iamkyu edited a comment on issue #10861:
URL: https://github.com/apache/shardingsphere/issues/10861#issuecomment-871460837


   @ysyysjbama @strongduanmu 
   any progress? I want to work for this issue if nothing has started


-- 
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 #10861: Double quote is removed when using AVG aggregation function

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


   


-- 
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] iamkyu commented on issue #10861: Double quote is removed when using AVG aggregation function

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


   @ysyysjbama @strongduanmu 
   any progress? I interested in this issue


-- 
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 #10861: Double quote is removed when using AVG aggregation function

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


   @ysyysjbama Thank you for your feedback, are you interested in submitting a PR to fix this problem?


-- 
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.

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



[GitHub] [shardingsphere] tristaZero closed issue #10861: Double quote is removed when using AVG aggregation function

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


   


-- 
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