You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Kedar Sankar Behera (JIRA)" <ji...@apache.org> on 2018/07/31 22:19:00 UTC
[jira] [Created] (DRILL-6654) Data verification failure with
lateral unnest query having filter in and order by
Kedar Sankar Behera created DRILL-6654:
------------------------------------------
Summary: Data verification failure with lateral unnest query having filter in and order by
Key: DRILL-6654
URL: https://issues.apache.org/jira/browse/DRILL-6654
Project: Apache Drill
Issue Type: Bug
Affects Versions: 1.14.0
Reporter: Kedar Sankar Behera
Attachments: Lateral Parquet.pdf, Lateral json.pdf, flatten.pdf
Data verification failure with lateral unnest query having filter in and order by .
lateral query -
{code}
select customer.c_custkey, customer.c_name, orders.totalprice from customer, lateral (select sum(t.o.o_totalprice) as totalprice from unnest(customer.c_orders) t(o) WHERE t.o.o_totalprice in (89230.03,270087.44,246408.53,82657.72,153941.38,65277.06,180309.76)) orders order by customer.c_custkey limit 50;
{code}
result :-
{code}
+------------+---------------------+-------------+
| c_custkey | c_name | totalprice |
+------------+---------------------+-------------+
| 101276 | Customer#000101276 | 82657.72 |
| 120295 | Customer#000120295 | 266119.96 |
| 120376 | Customer#000120376 | 180309.76 |
+------------+---------------------+-------------+
{code}
flatten query -
{code}
select f.c_custkey, f.c_name, sum(f.o.o_totalprice) from (select c_custkey, c_name, flatten(c_orders) as o from customer) f WHERE f.o.o_totalprice in (89230.03,270087.44,246408.53,82657.72,153941.38,65277.06,180309.76) group by f.c_custkey, f.c_name order by f.c_custkey limit 50;
{code}
result :-
{code}
+------------+---------------------+------------+
| c_custkey | c_name | EXPR$2 |
+------------+---------------------+------------+
| 101276 | Customer#000101276 | 82657.72 |
| 120376 | Customer#000120376 | 180309.76 |
+------------+---------------------+------------+
{code}
PS :- The above results are for Parquet type data .The same query for JSON data gives identical result given as follows :-
{code}
+------------+---------------------+------------+
| c_custkey | c_name | EXPR$2 |
+------------+---------------------+------------+
| 101276 | Customer#000101276 | 82657.72 |
| 120376 | Customer#000120376 | 180309.76 |
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)