ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
3.5k stars 491 forks source link

Error while importing CSV file #6069

Closed SloNN closed 3 days ago

SloNN commented 3 days ago

Created test data in PG. Exported data to File from psql

File contents:

date,boolean,uuid,bigint,timestamp without time zone,character varying,character varying[],point,integer,double precision,numeric,json,smallint
2011-11-11,f,c91cd37b-f4c1-4dd4-83b1-a2c9db7ce411,138383838388389,2011-11-11 11:11:33.23,"as;djfa;skldf asdf as;dkfjasdf, asd,f asdf ","{one,two,three}","(12.34,56.78)",12,2342.234393993,12345.67,"{""a"":1}",3

Try to import the file into YDB :

ydb -e grpcs://ydb-pg-5.ru-central1.internal:2135 -d /Root/database --ca-file ~/ydb-ansible-examples/TLS/CA/certs/ca.crt import file csv -p text pg_import.csv

But got an error:

Header contains less fields than data. Header: "", data: "date,boolean,uuid,bigint,timestamp without time zone,character varying,character varying[],point,integer,double precision,numeric,json,smallint"

Other utilities import the CSV-file with no problems.

SloNN commented 3 days ago

I forgot —header Command Line parameter