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

Can I use file paths as table names for DuckDB? #1498

Closed
max-sixty opened this issue Jan 13, 2023 Discussed in #1493 · 2 comments
Closed

Can I use file paths as table names for DuckDB? #1498

max-sixty opened this issue Jan 13, 2023 Discussed in #1493 · 2 comments

Comments

@max-sixty
Copy link
Member

max-sixty commented Jan 13, 2023

Discussed in #1493

Originally posted by eitsupi January 13, 2023
DuckDB can accept the path to a Parquet file as the table name.
For example, FROM 'test/*.parquet'.
Is there any way to use this in PRQL?
https://duckdb.org/docs/data/parquet.html

It seems that s-string cannot be used for this purpose.

I think this should™ be possible with:

from `test/*.parquet`

but unfortunately this returns:

Error:
   ╭─[:1:6]
   │
 1from `test/*.parquet`
   ·      ────────┬───────
   ·              ╰───────── Unsupported feature: advanced wildcard column matching
───╯

Maybe we need to give it a namespace, and so we should require:

from X=`test/*.parquet`

(currently this fails with the same error)


And it should also be possible with an s-string:

from s"test/*.parquet"

though we currently require SELECT here:

s-strings representing a table must start with `SELECT `

Instead, in from, we can take a table name without a SELECT?

Probably this needs someone who really cares about s-strings to do the work here. (me?)


For those who want to use this in the meantime, currently this works:

from s"select * from 'test/*.parquet'"
@max-sixty
Copy link
Member Author

#1516 would (kinda) solve this, and contains the broader tradeoff + suggestion for a broader change

@max-sixty
Copy link
Member Author

Closed by #1516, follow #1535 for the broader issue

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

No branches or pull requests

1 participant