[
https://issues.apache.org/jira/browse/HIVE-5800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13843575#comment-13843575
]
Xuefu Zhang commented on HIVE-5800:
-----------------------------------
This is addressed via HIVE-5856.
{code}
hive> explain select dec/s from test;
...
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -> Map Operator Tree:
test
TableScan
alias: test
Select Operator
expressions:
expr: (dec / s)
type: double
outputColumnNames: _col0
{code}
> Hive is inconsistent when handling strings in arithmetic operations
> -------------------------------------------------------------------
>
> Key: HIVE-5800
> URL: https://issues.apache.org/jira/browse/HIVE-5800
> Project: Hive
> Issue Type: Bug
> Components: Types
> Affects Versions: 0.12.0
> Reporter: Xuefu Zhang
> Assignee: Xuefu Zhang
>
> Currently Hive is inconsistent in dealing with strings involved in arithmetic
> operations. For instance:
> {code}
> hive> desc test;
> OK
> i int None
> b boolean None
> d double None
> s string None
> dec decimal(5,2) None
> Hive> explain select dec/s from test;
> ...
> STAGE PLANS:
> Stage: Stage-1
> Map Reduce
> Alias -> Map Operator Tree:
> test
> TableScan
> alias: test
> Select Operator
> expressions:
> expr: (dec / s)
> type: decimal(65,30)
> outputColumnNames: _col0
> hive> explain select dec*s from test;
> ...
> STAGE PLANS:
> Stage: Stage-1
> Map Reduce
> Alias -> Map Operator Tree:
> test
> TableScan
> alias: test
> Select Operator
> expressions:
> expr: (dec * s)
> type: double
> {code}
> MySQL consistently treats string in arithmetic operations as double (not an
> exact numeric type) and derives the operator result type accordingly. Hive
> should also be consistent.
> {code}
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)