8000 No order preservation for OR in where clause · Issue #17170 · duckdb/duckdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

No order preservation for OR in where clause #17170

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

Closed
1 of 2 tasks
domoritz opened this issue Apr 17, 2025 · 0 comments · Fixed by #17180
Closed
1 of 2 tasks

No order preservation for OR in where clause #17170

domoritz opened this issue Apr 17, 2025 · 0 comments · Fixed by #17180

Comments

@domoritz
Copy link
Contributor

What happens?

https://duckdb.org/docs/stable/sql/dialect/order_preservation.html says that the prefer of results is preserved with where clauses. But this does not work when there is an or in the query.

To Reproduce

CREATE TABLE tbl AS
    SELECT *
    FROM (VALUES (1, 'a'), (2, 'b'), (3, 'c')) t(x, y);

SELECT *
FROM tbl;
 select * from tbl where y = 'b' or y = 'a';

Results in

┌───────┬─────────┐
│   x   │    y    │
│ int32 │ varchar │
├───────┼─────────┤
│     2 │ b       │
│     1 │ a       │
└───────┴─────────┘

when it should be

┌───────┬─────────┐
│   x   │    y    │
│ int32 │ varchar │
├───────┼─────────┤
│     1 │ a       │
│     2 │ b       │
└───────┴─────────┘

OS:

macOS

DuckDB Version:

v1.2.2 7c03946

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Dominik Moritz

Affiliation:

CMU

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

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

Successfully merging a pull request may close this issue.

3 participants
0