Skip to content

New JDBC option to support INFILE and OUTFILE #1291

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

Merged
merged 4 commits into from
Mar 20, 2023
Merged

New JDBC option to support INFILE and OUTFILE #1291

merged 4 commits into from
Mar 20, 2023

Conversation

zhicwu
Copy link
Contributor

@zhicwu zhicwu commented Mar 19, 2023

Summary

New JDBC option localFile(boolean, defaults to false) to support INFILE and OUTFILE.

Usage

Add suffix ! to overwrite existing OUTFILE, and throw exception if INFILE does not exist or no record inserted.

drop table if exists test_in_and_out;
create table test_in_and_out(id UInt64, value String) engine=MergeTree order by id as
select number, toString(generateUUIDv4()) from numbers(1000000); -- 1,000,000 rows

-- my.csv.zst	CSV	zstd	-1	23664478
select * from test_in_and_out into outfile 'my.csv.zst';
-- my.csv.zst	TSV	lz4	5	41421620
select * from test_in_and_out into outfile 'my.csv.zst!' compression 'lz4' level 5 format TSV;

truncate table test_in_and_out;
insert into test_in_and_out from infile 'my.csv.zst!' compression 'lz4' format TSV;

Please pay attention that when using a database client like DBeaver, if you want to export/import all data, you need to change the row limit to zero.
image

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

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

Successfully merging this pull request may close these issues.

File data insert using CSVWithNames is failing in v0.4.1 FROM INFILE
1 participant