-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TPC-H Query 15 #166
Comments
Latest failure:
|
I'm looking into this issue and seeing a new error message:
This comes from missing a match case's if statement at
where 'total_revenue' is a column in 'revenue0' which is the view. The table default_catalog.default_schema.revenue0 can't be found in session context via the code path: This doesn't currently generate useful error output, but debugging led me here. Before moving forward too much further, I'd like context on the columns.is_empty() check if possible. I feel I may be missing something here. |
seems to show it came in via the initial support for views in #2279 by @matthewmturner |
@DaltonModlin if the check is removed, do the other tests still pass? If so, perhaps a new test (with aliases) and a new PR targeted at this one isolated change is a good next step. Folks like small PRs around here ;) |
As mentioned in #3266 I believe there are currently 3 more issues to be solved for a successful Q15 run.
|
This runs now, but returns 0 results most of the time. The way views are executed still looks a little funny to me, so to exclude the possibility of some bug in the view code, I converted it to a with statement like below: with revenue as (
select
l_suppkey as supplier_no,
sum(l_extendedprice * (1 - l_discount)) as total_revenue
from
lineitem
where
l_shipdate >= date '1996-01-01'
and l_shipdate < date '1996-01-01' + interval '3' month
group by
l_suppkey)
select
s_suppkey,
s_name,
s_address,
s_phone,
total_revenue
from
supplier,
revenue
where
s_suppkey = supplier_no
and total_revenue = (
select
max(total_revenue)
from
revenue
)
order by
s_suppkey; Running this query back to back multiple times usually returns 0 results, but sometimes it correctly returns the top supplier as it's supposed to -- 1 result: +-----------+--------------------+-------------------+-----------------+--------------------+
| s_suppkey | s_name | s_address | s_phone | total_revenue |
+-----------+--------------------+-------------------+-----------------+--------------------+
| 8449 | Supplier#000008449 | Wp34zim9qYFbVctdW | 20-469-856-8873 | 1772627.2086999998 |
+-----------+--------------------+-------------------+-----------------+--------------------+
1 row in set. Query took 3.363 seconds. I extracted just the WITH section to see what it's returning. And 2 back to back runs of this query shows different results for with revenue as (
select
l_suppkey as supplier_no,
sum(l_extendedprice * (1 - l_discount)) as total_revenue
from
lineitem
where
l_shipdate >= date '1996-01-01'
and l_shipdate < date '1996-01-01' + interval '3' month
group by
l_suppkey) select * from revenue order by 2 desc limit 1; +-------------+---------------+
| supplier_no | total_revenue |
+-------------+---------------+
| 8449 | 1772627.2087 |
+-------------+---------------+
1 row in set. Query took 2.959 seconds. then +-------------+--------------------+
| supplier_no | total_revenue |
+-------------+--------------------+
| 8449 | 1772627.2086999998 |
+-------------+--------------------+
1 row in set. Query took 2.554 seconds. I understand floating point results are uncertain. Is that what's going on here? |
I think for this to be correct we should switch to using a |
Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-11528
CREATE VIEW/multiple statement support: "The context currently only supports a single SQL statement"
{{Error: NotImplemented("The context currently only supports a single SQL statement")}}
The text was updated successfully, but these errors were encountered: