Skip to content
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

Add built-in scalar function for date intervals. #523

Open
bmyerz opened this issue Jun 6, 2016 · 0 comments
Open

Add built-in scalar function for date intervals. #523

bmyerz opened this issue Jun 6, 2016 · 0 comments

Comments

@bmyerz
Copy link
Member

bmyerz commented Jun 6, 2016

I would like the following template to work with TPC-H qgen.

Relevant portion is date_plus_months.

lineitem = scan('lineitem');
orders = scan('orders');

-- $ID$
-- TPC-H/TPC-R Order Priority Checking Query (Q4)
-- Functional Query Definition
-- Approved February 1998
exist = select 
    o_orderkey as e_key,
    COUNT(o_orderkey) as e_count
    from lineitem,
         orders
    where
        l_orderkey = o_orderkey
        and l_commitdate < l_receiptdate;

q4 = select 
    o_orderpriority,
    count(o_orderpriority) as order_count
    from
        orders,
        exist
    where
        e_key = o_orderkey
        and o_orderdate >= ':1'
        and o_orderdate < date_plus_months(':1', 3);
        and e_count > 0;
store(q4, q4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant