Skip to content

Unexpected behaviour when importing TabSeparatedWithNames or CSVWithNames  #2652

@siberex

Description

@siberex

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,6

Scenario:

$ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-documentationDocumentation (docs, examples, READMEs).comp-formatsInput/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions