0

I recently installed Clickhouse on my pc to work with a huge .csv (9Gb)

I know the columns names in this .csv file, so I easily created the table in the Clickhouse console

CREATE DATABASE IF NOT EXISTS MY_DB

CREATE TABLE MY_DB.MY_TB (
    "RC"   UInt64 NOT NULL,
    "COD"  UInt64 NOT NULL,
    "DESC" Nullable(String) DEFAULT 'NULL',
    "CAT"  Nullable(String) DEFAULT 'NULL',
    "PREC" Nullable(String) DEFAULT 'NULL',
    "SNP"  Nullable(String) DEFAULT 'NULL',  
    "GEN"  Nullable(String) DEFAULT 'NULL',
    "GSE"  Nullable(String) DEFAULT 'NULL',
    "COM"  Nullable(String) DEFAULT 'NULL',
    "CB"   Nullable(UInt8) DEFAULT 0,
    "ED"   Nullable(String) DEFAULT 'NULL' 
)
ENGINE = MergeTree()
PRIMARY KEY RC
ORDER BY RC

But when I try to import the data to this table, I get this error

Code: 19. DB::Exception: A setting's value string has to be an exactly one character long. (SIZE_OF_FIXED_STRING_DOESNT_MATCH)

I do this through the following command line in my Ubuntu 22.04.1 console

clickhouse-client --user=default --password=clickhouse --receive_timeout=3600 --send_timeout=3600 --connect_timeout=900 --format_csv_delimiter=";" --query="INSERT INTO MY_DB.MY_TB FORMAT CSVWithNames" < data.csv

Does anyone know why I get this error if I'm not defining any limit for the number of characters in the strings when I create the table?

mrR
  • 11
  • 1

1 Answers1

0

Mentioned by Bohemian, this looks like very much like the --format_csv_delimiter issue. https://github.com/ClickHouse/ClickHouse/issues/12744

I tested with a newer version of ClickHouse though. Both --format_csv_delimiter=',' and --format_csv_delimiter="," works.

bluesea
  • 429
  • 4
  • 9