-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Unexpected behaviour when importing TabSeparatedWithNames or CSVWithNames #2652
Copy link
Copy link
Closed
Labels
comp-documentationDocumentation (docs, examples, READMEs).Documentation (docs, examples, READMEs).comp-formatsInput/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).
Description
According to the docs, during parsing, the first row is completely ignored when using TabSeparatedWithNames or CSVWithNames formats.
ClickHouse client version 1.1.54390.
ClickHouse server version 1.1.54390.
Test files:
test.tsv:
This line should be ignored!
1 2 3
4 5 6
test.csv:
This line should be ignored!
1,2,3
4,5,6Scenario:
$ clickhouse-client --query='CREATE TABLE test(a String, b UInt8, c FixedString(1)) ENGINE = Log'
$ clickhouse-client --query="INSERT INTO test FORMAT TabSeparatedWithNames" < test.tsv
Code: 27. DB::Exception: Cannot parse input: expected \t before: \n1\t2\t3\n4\t5\t6\n
$ clickhouse-client --query="INSERT INTO test FORMAT CSVWithNames" < test.csv
Code: 27. DB::Exception: Cannot parse input: expected , before: \n1,2,3\n4,5,6
First row is not ignored at all!
Import will only work after updating first row with column definition and exactly the same columns number as defined in recipient table:
a,b,c
1,2,3
4,5,6
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp-documentationDocumentation (docs, examples, READMEs).Documentation (docs, examples, READMEs).comp-formatsInput/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).