Copy from file which contains Chinese characters failed.
My test table is
create table t1(a int not null primary key, b varchar(1024));
My test file d:\data.txt contains two lines
1,测试1
2,测试2
I have tried to save the data file using ANSI and UTF8 encoding using Notepad on windows,
and tried to start mclient with -Ecp437, -Ecp936 and -Eutf-8 option, neither combination of the
file encoding and mclient encoding can load the file correctlly.
When both using utf-8 the following error messages appears:
sql>copy into t1 from 'd:\\data.txt' using delimiters ',', '\r\n';
!SQLException:importTable:failed to import table
!ERROR: value 'ï»?' while parsing 'ï»?,顾å°æ³?
!ERROR: 2,覃� from line 0 field 0 not inserted, expecting type int
!ERROR: TABLETload_bulk: read error (after loading 0 records)
0 tuples
When using other combinations, the following messages appears:
sql>copy into t1 from 'd:\\data.txt' using delimiters ',', '\r\n';
0 tuples
write error
sql>
The following steps works, but the exported data.txt isn't readable by human.
mclient XXXXX -Ecp437
delete from t1;
insert into t1 values(1,'²âÊÔ1');
insert into t1 values(2,'²âÊÔ2');
copy select * from t1 into 'd:\\data.txt' using delimiters ',' ,'\r\n';
delete from t1;
copy into t1 from 'd:\\data.txt' using delimiters ',' ,'\r\n';
Get news, entertainment and everything you care about at Live.com. Check it out!