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

Support fully qualified file names in CREATE TABLE and INSERT commands #108

Open
KayKursawe opened this issue May 22, 2023 · 3 comments
Open

Comments

@KayKursawe
Copy link

KayKursawe commented May 22, 2023

In SELECT statements, i can specify a fully qualified file to be queried, e. g.
SELECT a, b, c FROM file:/foo/bar

However, in CREATE TABLE and INSERT statements (and probably a few others) this doesn't work. Instead, all that seems to work is to specifiy the filename without the leading path and without the trailing file extension as a table name:
CREATE TABLE foo(a, b, c)

How about providing the file: notation consistently to all statements?

@KayKursawe KayKursawe changed the title Support filenames with extension in CREATE TABLE and INSERT commands Support fully qualified file names in CREATE TABLE and INSERT commands May 22, 2023
@kpym
Copy link

kpym commented May 22, 2023

Have you tried enclosing the filename in backticks?

SELECT a, b, c FROM `/foo/bar`

@KayKursawe
Copy link
Author

SELECT is not an issue, fully qualified paths are working. I'm talking about CREATE TABLE and INSERT statements.

Since SELECT a, b, c FROM file:/foo/bar.csv is working using the file: notation, I'd be happy to use that in any other statement, too, like this:
CREATE TABLE file:/foo/bar.csv(a, b, c)
INSERT INTO file:/foo/bar.csv(a, b, c) VALUES (1, 2, 3)

Atm, this is the only way it works:
CREATE TABLE foo(a, b, c)
INSERT INTO foo(a, b, c) VALUES (1, 2, 3)

@mithrandie
Copy link
Owner

The file specification in URL format is intended to be read-only. Therefore, it can currently be used only in SELECT queries.
However, it is true that specifying local files in URL format is useful when creating or updating files. I'll consider supporting it.

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

3 participants