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 2022/11/23 08:35:19 UTC

[GitHub] [shardingsphere] wsm12138 opened a new issue, #22360: About digital presentation,Proxy have different with DB

wsm12138 opened a new issue, #22360:
URL: https://github.com/apache/shardingsphere/issues/22360

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   792829660d2bf7b2dbc7890d8431242a47541333
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   SS have same performance
   ### Actual behavior
   #### proxy 
   <img width="946" alt="image" src="https://user-images.githubusercontent.com/86462784/203500635-2c3114f1-4cdc-4f5d-a10d-36072ee1377a.png">
   
   <img width="607" alt="image" src="https://user-images.githubusercontent.com/86462784/203501908-a576fbf0-838a-41c5-ac03-d45404be316a.png">
   
   #### DB
   
   <img width="853" alt="image" src="https://user-images.githubusercontent.com/86462784/203501741-df7bc353-734c-48df-84c0-39321f58326c.png">
   
   
   
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   case like https://github.com/apache/shardingsphere/issues/22170
   
   ```
   test=> \d t_ssdb_tb
         Table "public.t_ssdb_tb"
    Column |     Type      | Modifiers
   --------+---------------+-----------
    id     | integer       |
    c_id   | integer       |
    a      | integer       |
    b      | character(10) |
   ```
   ### 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.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #22360: About digital presentation,Proxy have different with DB

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #22360:
URL: https://github.com/apache/shardingsphere/issues/22360#issuecomment-1407541735

   Closed for duplicate of https://github.com/apache/shardingsphere/issues/15593


-- 
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 #22360: About digital presentation,Proxy have different with DB

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

   Yes, you are right. Now, ShardingSphere only supports 4 decimal places, which seems to be the behavior of mysql.
   
   ```java
   /**
    * Average aggregation unit.
    */
   @RequiredArgsConstructor
   public final class AverageAggregationUnit implements AggregationUnit {
       
       private BigDecimal count;
       
       private BigDecimal sum;
       
       @Override
       public void merge(final List<Comparable<?>> values) {
           if (null == values || null == values.get(0) || null == values.get(1)) {
               return;
           }
           if (null == count) {
               count = new BigDecimal("0");
           }
           if (null == sum) {
               sum = new BigDecimal("0");
           }
           count = count.add(new BigDecimal(values.get(0).toString()));
           sum = sum.add(new BigDecimal(values.get(1).toString()));
       }
       
       @Override
       public Comparable<?> getResult() {
           if (null == count || BigDecimal.ZERO.equals(count)) {
               return count;
           }
           // TODO use metadata to fetch float number precise for database field
           return sum.divide(count, 4, RoundingMode.HALF_UP);
       }
   }
   ```


-- 
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] RaigorJiang closed issue #22360: About digital presentation,Proxy have different with DB

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #22360: About  digital presentation,Proxy have different with DB
URL: https://github.com/apache/shardingsphere/issues/22360


-- 
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 #22360: About digital presentation,Proxy have different with DB

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

   Related with #15593


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