sohami commented on a change in pull request #1451: DRILL-6710: Disallow 
negative scale for VarDecimal
URL: https://github.com/apache/drill/pull/1451#discussion_r213928418
 
 

 ##########
 File path: 
exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java
 ##########
 @@ -170,6 +170,8 @@ public void eval() {
               left.precision, left.scale,
               right.precision, right.scale);
 
+      // Do the verification of computed scale and precision here based on 
actual data
+      typeInference.verifyScaleAndPrecision();
 
 Review comment:
   I don't see moving the verification check here rather than doing in planning 
time helps. Since for each addition call we still increase the precision by 1, 
hence for 39 such additions precision will go beyond max allowed 38 and scale 
will become -1, hence throwing the error.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to