[ https://issues.apache.org/jira/browse/HIVE13380?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=15323348#comment15323348
]
Sergey Shelukhin edited comment on HIVE13380 at 6/9/16 9:03 PM:

Per SQL92:
{noformat}
5.3
<exact numeric literal> ::=
<unsigned integer> [ <period> [ <unsigned integer> ] ]
 <period> <unsigned integer>
<approximate numeric literal> ::= <mantissa> E <exponent>
13)The data type of an <exact numeric literal> is exact numeric.
The precision of an <exact numeric literal> is the number of
<digit>s that it contains. The scale of an <exact numeric lit
eral> is the number of <digit>s to the right of the <period>.
6.12
1) If the data type of both operands of a dyadic arithmetic opera
tor is exact numeric, then the data type of the result is exact
numeric, with precision and scale determined as follows:
a) Let S1 and S2 be the scale of the first and second operands
respectively.
b) The precision of the result of addition and subtraction is
implementationdefined, and the scale is the maximum of S1
and S2.
c) The precision of the result of multiplication is implementation
defined, and the scale is S1 + S2.
d) The precision and scale of the result of division is
implementationdefined.
{noformat}
Exact numeric is basically decimal in this case
was (Author: sershe):
Per SQL92:
{noformat}
5.3
<exact numeric literal> ::=
<unsigned integer> [ <period> [ <unsigned integer> ] ]
 <period> <unsigned integer>
<approximate numeric literal> ::= <mantissa> E <exponent>
13)The data type of an <exact numeric literal> is exact numeric.
The precision of an <exact numeric literal> is the number of
<digit>s that it contains. The scale of an <exact numeric lit
eral> is the number of <digit>s to the right of the <period>.
6.12
1) If the data type of both operands of a dyadic arithmetic opera
tor is exact numeric, then the data type of the result is exact
numeric, with precision and scale determined as follows:
a) Let S1 and S2 be the scale of the first and second operands
respectively.
b) The precision of the result of addition and subtraction is
implementationdefined, and the scale is the maximum of S1
and S2.
c) The precision of the result of multiplication is implementation
defined, and the scale is S1 + S2.
d) The precision and scale of the result of division is
implementationdefined.
{noformat}
> Decimal should have lower precedence than double in type hierachy
> 
>
> Key: HIVE13380
> URL: https://issues.apache.org/jira/browse/HIVE13380
> Project: Hive
> Issue Type: Bug
> Components: Types
> Reporter: Ashutosh Chauhan
> Assignee: Ashutosh Chauhan
> Labels: TODOC2.1
> Fix For: 2.1.0
>
> Attachments: HIVE13380.2.patch, HIVE13380.4.patch, HIVE13380.5.patch, HIVE13380.patch,
decimal_filter.q
>
>
> Currently its other way round. Also, decimal should be lower than float.

This message was sent by Atlassian JIRA
(v6.3.4#6332)
