Skip to content

Support SELECT .. INTO OUTFILE ..TRUNCATE| APPEND.. #888

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

Open
jovezhong opened this issue Dec 29, 2024 · 1 comment
Open

Support SELECT .. INTO OUTFILE ..TRUNCATE| APPEND.. #888

jovezhong opened this issue Dec 29, 2024 · 1 comment
Assignees

Comments

@jovezhong
Copy link
Contributor

In recent version of ClickHouse, there are settings for INTO OUTFILE to specify when the outfile exists, whether to append to clean up content and add.

https://clickhouse.com/docs/en/sql-reference/statements/select/into-outfile

When writing to a file that already exists, APPEND or TRUNCATE must be used.

However this is not available in Timeplus Proton.

Code: 62. DB::Exception: Syntax error: failed at position 1370 ('TRUNCATE') (line 31, col 56): TRUNCATE FORMAT LineAsString
. Expected one of: COMPRESSION, FORMAT, SETTINGS, end of query. (SYNTAX_ERROR)

The use case is to follow the ClickHouse docs script to generate the markdown based on settings source code.

SELECT prefix || (SELECT group_concat(*) FROM main_content)
INTO OUTFILE 'docs/en/operations/settings/settings.md' TRUNCATE FORMAT LineAsString
@jovezhong
Copy link
Contributor Author

Oops, if I remove the TRUNCATE before the FORMAT LineAsString, the DB exception shows INTO OUTFILE is not allowed, but I remember this works before

Received exception from server (version 1.6.6):
Code: 358. DB::Exception: Received from localhost:8463. DB::Exception: INTO OUTFILE is not allowed. (INTO_OUTFILE_NOT_ALLOWED)

@jovezhong jovezhong changed the title Support APPEND or TRUNCATE in SELECT .. INTO OUTFILE ..TRUNCATE.. Support SELECT .. INTO OUTFILE ..TRUNCATE| APPEND.. Dec 29, 2024
@yokofly yokofly assigned yokofly and unassigned chenziliang Dec 30, 2024
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