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

Crash on single-argument COALESCE #1222

Closed
alanpaulkwan opened this issue Dec 13, 2020 · 7 comments · Fixed by #1223
Closed

Crash on single-argument COALESCE #1222

alanpaulkwan opened this issue Dec 13, 2020 · 7 comments · Fixed by #1223
Assignees

Comments

@alanpaulkwan
Copy link

alanpaulkwan commented Dec 13, 2020

I can PM someone the data. This is the valid query:


res=dbGetQuery(con,"select recipient_duns,count() as n_contracts,sum(coalesce(potential_total_value_of_award,0)) as award,
              max(action_date_fiscal_year) as year_max,
              min(action_date_fiscal_year) as year_min,
              sum(case when place_of_manufacture like '%OUTSIDE%U%S%' then 1 else 0 end) contracts_outside_usa,
              sum(case when place_of_manufacture like '%OUTSIDE%U%S%' then coalesce(potential_total_value_of_award,0) else 0 end) dollarval_contracts_outside_usa
           from parquet_scan('*201[5-9]*/*parquet') group by recipient_duns")

This is the errant query. It should just complain but rather R crashes giving me an option to core dump. The errant query is in the phrase coalesce(potential_total_value_of_award0) e.g. no comma

res=dbGetQuery(con,"select recipient_duns,count() as n_contracts,sum(coalesce(potential_total_value_of_award,0)) as award,
              max(action_date_fiscal_year) as year_max,
              min(action_date_fiscal_year) as year_min,
              sum(case when place_of_manufacture like '%OUTSIDE%U%S%' then 1 else 0 end) contracts_outside_usa,
              sum(case when place_of_manufacture like '%OUTSIDE%U%S%' then coalesce(potential_total_value_of_award0) else 0 end) dollarval_contracts_outside_usa
           from parquet_scan('*201[5-9]*/*parquet') group by recipient_duns")
@hannes hannes self-assigned this Dec 13, 2020
@hannes
Copy link
Member

hannes commented Dec 13, 2020

Already seeing the issue on select coalesce(1), so no need to share the data for now

hannes added a commit to hannes/duckdb that referenced this issue Dec 13, 2020
@hannes hannes linked a pull request Dec 13, 2020 that will close this issue
@hannes hannes changed the title DuckDB crash with case when Crash on single-argument COALESCE Dec 13, 2020
@hannes
Copy link
Member

hannes commented Dec 13, 2020

@alanpaulkwan can you please check and confirm if this is indeed fixed on master?

@alanpaulkwan
Copy link
Author

@hannesmuehleisen i just installed the bleeding edge via R. It is not as select coalesce(1) just crashed everything.

@hannes
Copy link
Member

hannes commented Dec 14, 2020

@alanpaulkwan sorry I can't parse that sentence. If it still crashes please do share your files to hannes@cwi.nl

@alanpaulkwan
Copy link
Author

alanpaulkwan commented Dec 15, 2020

Sorry, what I mean was: I just reinstalled the latest version via the install instructions on your DuckDB page. I get the below, which suggests it was not fixed, as of a rebuild I did yesterday per your request. Rebuilding again right now just to check.

image

@hannes
Copy link
Member

hannes commented Dec 15, 2020

This works fine for me, I suspect you still have an old version. Whats your output of dbGetQuery(con, "pragma version")? I get

  library_version source_id
1    0.2.4-dev103 5eff21830

@alanpaulkwan
Copy link
Author

alanpaulkwan commented Dec 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants