[ https://issues.apache.org/jira/browse/DRILL-6710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593412#comment-16593412 ]
Volodymyr Vysotskyi edited comment on DRILL-6710 at 8/27/18 11:09 AM: ---------------------------------------------------------------------- Taking into account the majority of the projects which support only non-negative scale and limitations of current implementation for negative scale, I agree with you that we should also prevent usage of negative scale. Currently, it may appear as the result of some math functions. [~rhou], Drill has a little bit different way for trimming scale. This formula also may return a negative scale, if {{precision}} is less than {{max(p1 – s1, p2 – s2)}}. was (Author: vvysotskyi): Taking into account the majority of the projects which support only non-negative scale and limitations of current implementation for negative scale, I agree with you that we should also prevent usage of negative scale. Currently, it may appear as the result of some math functions. [~rhou], Drill has a little bit different way for trimming scale. This formula also may return a negative scale, if {{precision}} is less then {{max(p1 – s1, p2 – s2)}}. > Drill C++ Client does not handle scale = 0 properly for decimal > --------------------------------------------------------------- > > Key: DRILL-6710 > URL: https://issues.apache.org/jira/browse/DRILL-6710 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Relational Operators > Affects Versions: 1.14.0 > Reporter: Robert Hou > Assignee: Sorabh Hamirwasia > Priority: Major > Fix For: 1.15.0 > > > Query is: > select cast('999999999999999999' as decimal(18,0)) + > cast('9999999999999999999999999999999999999' as decimal(38,0)) from data > limit 1 > This is the error I get when my test program calls SQLExecDirect: > The driver reported the following diagnostics whilst running SQLExecDirect > HY000:1:40140:[MapR][Support] (40140) Scale can't be less than zero. -- This message was sent by Atlassian JIRA (v7.6.3#76005)