morrySnow commented on code in PR #19811:
URL: https://github.com/apache/doris/pull/19811#discussion_r1209770292


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Divide.java:
##########
@@ -62,14 +63,15 @@ public DataType getDataType() throws UnboundException {
     @Override
     public DecimalV3Type getDataTypeForDecimalV3(DecimalV3Type t1, 
DecimalV3Type t2) {
         int retPercision = t1.getPrecision() + t2.getScale();

Review Comment:
   percision should also update with div_precision_increment



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Divide.java:
##########
@@ -62,14 +63,15 @@ public DataType getDataType() throws UnboundException {
     @Override
     public DecimalV3Type getDataTypeForDecimalV3(DecimalV3Type t1, 
DecimalV3Type t2) {
         int retPercision = t1.getPrecision() + t2.getScale();
-        int retScale = t1.getScale();
+        int retScale = t1.getScale() + t2.getScale()
+                + Config.div_precision_increment;

Review Comment:
   should be the first argument scale + div_precision_increment ? 
   ```suggestion
           int retScale = t1.getScale() + Config.div_precision_increment;
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Divide.java:
##########
@@ -62,14 +63,15 @@ public DataType getDataType() throws UnboundException {
     @Override
     public DecimalV3Type getDataTypeForDecimalV3(DecimalV3Type t1, 
DecimalV3Type t2) {
         int retPercision = t1.getPrecision() + t2.getScale();
-        int retScale = t1.getScale();
+        int retScale = t1.getScale() + t2.getScale()
+                + Config.div_precision_increment;

Review Comment:
   use a session variable maybe better?



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to