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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]