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

bug: can not execute multi line query #233

Closed
BohuTANG opened this issue Sep 24, 2023 · 1 comment · Fixed by #236
Closed

bug: can not execute multi line query #233

BohuTANG opened this issue Sep 24, 2023 · 1 comment · Fixed by #236
Labels
bug Something isn't working

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Sep 24, 2023

Query:

-- TPC-H 1
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 <= add_days(to_date('1998-12-01'), -90) group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus;

Error:

❯ bendsql -q "-- TPC-H 1
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 <= add_days(to_date('1998-12-01'), -90) group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus;" --time
error: unexpected argument '-- TPC-H 1
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 <' found

@BohuTANG BohuTANG added the bug Something isn't working label Sep 24, 2023
@everpcpc
Copy link
Member

everpcpc commented Sep 25, 2023

This is a problem with argument parsing for --.
We should only allow passing query in command line args with --query='-- TPC-H 1'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants