Rahul Challapalli created DRILL-1182:
----------------------------------------
Summary: Decimal has an issue when used in case statement where
the else expression contains a literal
Key: DRILL-1182
URL: https://issues.apache.org/jira/browse/DRILL-1182
Project: Apache Drill
Issue Type: Bug
Components: Execution - Data Types
Reporter: Rahul Challapalli
git.commit.id.abbrev=e5c2da0
The below query fails with an Assertion Error:
select
case
when l_linestatus = 'Success' then l_extendedprice
else 0
end
from lineitem;
The source 'lineitem' is a view on top of a txt file. While creating the view
when we change the type of l_extendedprice from decimal to double, this issue
goes away. Below is the original view definition:
create view lineitem as select cast(columns[0] as int) l_orderkey,
cast(columns[1] as int) l_partkey, cast(columns[2] as int) l_suppkey,
cast(columns[3] as int) l_linenumber, cast(columns[4] as decimal) l_quantity,
cast(columns[5] as decimal) l_extendedprice, cast(columns[6] as decimal)
l_discount, cast(columns[7] as decimal) l_tax, columns[8] l_returnflag,
columns[9] l_linestatus, cast(columns[10] as date) l_shipdate, cast(columns[11]
as date) l_commitdate, cast(columns[12] as date) l_receiptdate, columns[13]
l_shipinstruct, columns[14] l_shipmode, columns[15] l_comment from
`lineitem.tbl`;
I also attached the log file along with the source data. Let me know if you
have any questions
--
This message was sent by Atlassian JIRA
(v6.2#6252)