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

SELECT * SIMILAR TO <regexp> AS <name> ignores <name> #15072

Closed
2 tasks done
soerenwolfers opened this issue Dec 1, 2024 · 0 comments · Fixed by #15247 or duckdb/duckdb-r#837
Closed
2 tasks done

SELECT * SIMILAR TO <regexp> AS <name> ignores <name> #15072

soerenwolfers opened this issue Dec 1, 2024 · 0 comments · Fixed by #15247 or duckdb/duckdb-r#837

Comments

@soerenwolfers
Copy link
Contributor

soerenwolfers commented Dec 1, 2024

What happens?

The newly introduced SELECT * SIMILAR TO <pattern> syntax (and the related LIKE / GLOB versions) ignores subsequent AS clauses.

Ideally, it'd treat them just like COLUMNS(<pattern>) AS <name> including allowing for matching group references.

To Reproduce

SELECT * SIMILAR TO 'number(\d+)' AS '\1'
FROM (SELECT 1 AS number1, 2 AS number2, 3 AS end)

and

SELECT * SIMILAR TO 'number(\d+)' AS test
FROM (SELECT 1 AS number1, 2 AS number2, 3 AS end)

both return columns number1 and number2, completely ignoring the AS clause.

OS:

Linux

DuckDB Version:

1.1.4

DuckDB Client:

Python

Hardware:

i5, AMD64

Full Name:

Soeren Wolfers

Affiliation:

G-Research

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

I have tested with a nightly build

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

Not applicable - the reproduction does not require a data set

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
Mytherin added a commit that referenced this issue Dec 10, 2024
krlmlr added a commit to duckdb/duckdb-r that referenced this issue Dec 27, 2024
Fix duckdb/duckdb#15072 and duckdb/duckdb#15073: propagate aliases correctly in * SIMILAR TO, and forbid `RENAME` as well (duckdb/duckdb#15247)
Linenoise: make Ctrl+G execute the query (duckdb/duckdb#15244)
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this issue Dec 29, 2024
Fix duckdb/duckdb#15072 and duckdb/duckdb#15073: propagate aliases correctly in * SIMILAR TO, and forbid `RENAME` as well (duckdb/duckdb#15247)
Linenoise: make Ctrl+G execute the query (duckdb/duckdb#15244)
github-actions bot added a commit to duckdb/duckdb-r that referenced this issue Dec 29, 2024
Fix duckdb/duckdb#15072 and duckdb/duckdb#15073: propagate aliases correctly in * SIMILAR TO, and forbid `RENAME` as well (duckdb/duckdb#15247)
Linenoise: make Ctrl+G execute the query (duckdb/duckdb#15244)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment