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

Omitted rows from result / results returned on error #1329

Closed
jonathanswenson opened this issue Jul 17, 2023 · 2 comments
Closed

Omitted rows from result / results returned on error #1329

jonathanswenson opened this issue Jul 17, 2023 · 2 comments
Assignees

Comments

@jonathanswenson
Copy link

jonathanswenson commented Jul 17, 2023

What happens?

When I run the following query on duckdb shell, I get different results than when I run it in the CLI

with data as ( 
  select 2 as "col1" 
  union all 
  select 1 
  union all 
  select 0 
  union all 
  select -1
) select col1, ln(col1) from data;

In shell / wasm I get a result back, but for some reason it only has a single row and does not show any error
image

In the cli I get an error (I think that's what expected).

v0.8.2-dev1764 07b0b0a2a4
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D with data as ( select 2 as "col1" union all select 1 union all select 0 union all select -1) select col1, ln(col1) from data;
Error: Out of Range Error: cannot take logarithm of zero

To Reproduce

with data as ( 
  select 2 as "col1" 
  union all 
  select 1 
  union all 
  select 0 
  union all 
  select -1
) select col1, ln(col1) from data;

Browser/Environment:

Chrome 114

Device:

Macbook Pro M1

DuckDB-Wasm Version:

v0.8.2-dev1585

DuckDB-Wasm Deployment:

shell.duckdb.org

Full Name:

Jonathan Swenson

Affiliation:

Omni

@carlopi
Copy link
Collaborator

carlopi commented Jun 17, 2024

Update: this now makes a bit more sense, see https://shell.duckdb.org/#queries=v0,with-data-as-(-%0A--select-2-as-%22col1%22-%0A--union-all-%0A--select-1-%0A--union-all-%0A--select-0-%0A--union-all-%0A--select-%201%0A)-select-col1%2C-ln(col1)-from-data~, where an empty result is shown instead of a broken ones.

Still is not ideal, we need to find where the ConversionErrors disappears.

@carlopi
Copy link
Collaborator

carlopi commented Sep 27, 2024

Update/2: Now this fails as it in the CLI.

CLI:

carlo@ScroogeMcDuck duckdb_httpfs % duckdb
v1.1.1 af39bd0dcf
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D with data as ( 
    select 2 as "col1" 
    union all 
    select 1 
    union all 
    select 0 
    union all 
    select -1
  ) select col1, ln(col1) from data;
Out of Range Error: cannot take logarithm of zero
D 

DuckDB Wasm:

duckdb> with data as ( 
   ...>   select 2 as "col1" 
   ...>   union all 
   ...>   select 1 
   ...>   union all 
   ...>   select 0 
   ...>   union all 
   ...>   select -1
   ...> ) select col1, ln(col1) from data;
Out of Range Error: cannot take logarithm of zero

(see live at https://shell.duckdb.org/#queries=v0,with-data-as-(-%0A--select-2-as-%22col1%22-%0A--union-all-%0A--select-1-%0A--union-all-%0A--select-0-%0A--union-all-%0A--select-%201%0A)-select-col1%2C-ln(col1)-from-data)

@carlopi carlopi closed this as completed Sep 27, 2024
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

No branches or pull requests

2 participants