You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "dujl (via GitHub)" <gi...@apache.org> on 2023/06/11 14:54:54 UTC

[GitHub] [doris] dujl opened a new pull request, #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

dujl opened a new pull request, #20678:
URL: https://github.com/apache/doris/pull/20678

   ## Proposed changes
   
   Issue Number: close #xxx
   
   in round function,  when the src data is decimalv3 and the scale parameter is large than src data's scale, the round result  scale will be set to source data's scale, but it use scale parameter to create the result column.  This will result in the round result is wrong.
   
   ```
   CREATE TABLE `tb_round_decimal` (
             `id` int NOT NULL COMMENT '',
             `d1` decimalv3(9, 4) NULL COMMENT '',
             `d2` decimalv3(27, 4)  NULL DEFAULT "0" ,
             `d3` decimalv3(38, 4)  NULL
           ) ENGINE=OLAP
           UNIQUE KEY(`id`)
           DISTRIBUTED BY HASH(`id`) BUCKETS 10
           PROPERTIES (
           "replication_allocation" = "tag.location.default: 1"
           ); 
   
   
   insert into tb_round_decimal values (1, 123.56789, 234.67895, 345.78956); 
   insert into tb_round_decimal values (2, 123.56789, 234.67895, 345.78956); 
   
   select cast(round(sum(d1), 6) as double), cast(round(sum(d2), 6) as double), cast(round(sum(d3), 6) as double) from tb_round_decimal ;
   ```
   
   before:
   
   ```
   2.471356	  4.693578	6.91579
   ```
   
   after:
   ```
   247.1356	469.3578	691.579
   ```
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586195896

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586458902

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1588578593

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586683056

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586738141

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1590796887

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1591242580

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1598018631

   run buildall
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1587095754

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1590570176

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1594663304

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1588773142

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1590572037

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] xiaokang merged pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang merged PR #20678:
URL: https://github.com/apache/doris/pull/20678


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586535775

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586703230

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1586458787

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1598908669

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1595585251

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1588440378

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dujl commented on pull request #20678: [fix](decimalv3) fix result error when cast a round decimalv3 to double

Posted by "dujl (via GitHub)" <gi...@apache.org>.
dujl commented on PR #20678:
URL: https://github.com/apache/doris/pull/20678#issuecomment-1594594999

   run p0


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org