8000 `COLUMNS(x -> <anything>) ` treats tokens in `<anything>` as string literals even when not in quotes · Issue #16163 · duckdb/duckdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

COLUMNS(x -> <anything>) treats tokens in <anything> as string literals even when not in quotes #16163

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
2 tasks done
soerenwolfers opened this issue Feb 10, 2025 · 1 comment · Fixed by #16193
Closed
2 tasks done

Comments

@soerenwolfers
Copy link
Contributor
soerenwolfers commented Feb 10, 2025

What happens?

COLUMNS(x -> <anything>) treats tokens in <anything> as string literals even when not in quotes.

To Reproduce

SELECT COLUMNS(x -> x.type[3] = 't') FROM range(1); -- e.g., user wants to filter for integers, but gets all columns
┌───────┐
│ range │
│ int64 │
├───────┤
│     0 │
└───────┘
SELECT COLUMNS(x -> asdf >= asdf) FROM range(1); 
┌───────┐
│ range │
│ int64 │
├───────┤
│     0 │
└───────┘

OS:

Linux

DuckDB Version:

1.2

DuckDB Client:

Python

Hardware:

.

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
@soerenwolfers soerenwolfers changed the title SELECT COLUMNS(x -> x.name[1] = 'x') FROM range(1); treats x.name as string literal COLUMNS(x -> <anything>) treats <anystring> as string literal even when it isn't in quotes Feb 10, 2025
@soerenwolfers soerenwolfers changed the title COLUMNS(x -> <anything>) treats <anystring> as string literal even when it isn't in quotes COLUMNS(x -> <anything>) treats tokens in <anything> as string literals even when not in quotes Feb 10, 2025
@paultiq
Copy link
paultiq commented Feb 10, 2025

+1.

Another version of this that I was recently fighting with. In this case, I was trying to pass a list into the columns expression:

with q1 as (select ['somerange'] as selected_cols)
    select 
        columns(c->c in selected_cols) from q1, range(10) t(somerange)

selected_cols
[somerange]
...

Yet this had the expected result:

  select 
      columns(c->c in ['somerange'])
      from range(10) t(somerange)

Mytherin added a commit to Mytherin/duckdb that referenced this issue Feb 11, 2025
< 8000 svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-cross-reference">
Antonov548 added a commit to Antonov548/duckdb-r that referenced this issue Feb 27, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
krlmlr pushed a commit to duckdb/duckdb-r that referenced this issue Mar 5, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
krlmlr added a commit to duckdb/duckdb-r that referenced this issue May 15, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
krlmlr added a commit to duckdb/duckdb-r that referenced this issue May 15, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
krlmlr added a commit to duckdb/duckdb-r that referenced this issue May 17, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
krlmlr added a commit to duckdb/duckdb-r that referenced this issue May 18, 2025
Fix duckdb/duckdb#16163: COLUMNS should not treat identifiers as strings (duckdb/duckdb#16193)
Only delete test directory when `--test-temp-dir` is not specified (duckdb/duckdb#16192)
unified names for duckdb-extensions (duckdb/duckdb#16179)
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.

4 participants
0