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 21:44:28 UTC
[GitHub] vvysotskyi commented on a change in pull request #1453: DRILL-6710:
Disallow negative scale for decimal data type
vvysotskyi commented on a change in pull request #1453: DRILL-6710: Disallow negative scale for decimal data type
URL: https://github.com/apache/drill/pull/1453#discussion_r214175568
##########
File path: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/output/DecimalReturnTypeInference.java
##########
@@ -277,7 +277,7 @@
return TypeProtos.MajorType.newBuilder()
.setMinorType(attributes.getReturnValue().getType().getMinorType())
- .setScale(scale)
+ .setScale(Math.max(scale, 0))
Review comment:
Checks for type inference rules in this class were added only for the cases when resulting scale/precision depends on the input scale/precision and may become incorrect for correct values of the scale/precision.
But for the cases when resulting scale/precision is the same as the input scale/precision, there is no need to add checks since it should be validated at the stage when such scale/precision is set to the major type.
----------------------------------------------------------------
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