Does Daft support `interval` in SQL expression? I ...
# daft-dev
a
Does Daft support
interval
in SQL expression? I noticed it supports DataFrame usage https://github.com/Eventual-Inc/Daft/issues/2995 But I failed at running queries with
interval
like those in TPC-H Q1 or Q5. For example,
Copy code
-- SQLBench-H query 1 derived from TPC-H query 1 under the terms of the TPC Fair Use Policy.
-- TPC-H queries are Copyright 1993-2022 Transaction Processing Performance Council.
select
	l_returnflag,
	l_linestatus,
	sum(l_quantity) as sum_qty,
	sum(l_extendedprice) as sum_base_price,
	sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
	sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
	avg(l_quantity) as avg_qty,
	avg(l_extendedprice) as avg_price,
	avg(l_discount) as avg_disc,
	count(*) as count_order
from
	lineitem
where
	l_shipdate <= date '1998-12-01' - interval '68 days'
group by
	l_returnflag,
	l_linestatus
order by
	l_returnflag,
	l_linestatus;
I checked the benchmark code which is not written in SQL expression https://github.com/Eventual-Inc/distributed-query-benchmarking/blob/main/distributed_query_benchmarking/daft_queries/queries.py
j
😛 we noticed it too, and have a PR out for it: https://github.com/Eventual-Inc/Daft/pull/3018 Was merged, will make it in the next release
(We’re cutting tomorrow morning PST!)
🚀 1
Also @Cory Grinstead might be able to add more color around what works/doesn’t work yet in SQL for those TPC-H questions
❤️ 1
a
aha nice! thanks @jay for the info 🙌
c
intervals should work now, but many tpch queries use the cross style joins (
from a,b where a.x = b.y
). We're working on adding support for these in the immediate future.
🙏 1
a
yeh I see. I saw
daft.exceptions.InvalidSQLException: Unsupported SQL: 'Only exactly one table is supported'
thanks for all the works anyway!