You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/08/30 07:28:49 UTC

[GitHub] sohami commented on a change in pull request #1451: DRILL-6710: Disallow negative scale for VarDecimal

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:
users@infra.apache.org


With regards,
Apache Git Services