我有多个30GB / 10亿记录文件,需要将它们加载到Netezza中。我正在使用pyodbc
连接并运行以下命令。
create temp table tbl1(id bigint, dt varchar(12), ctype varchar(20), name varchar(100)) distribute on (id)
insert into tbl1
select * from external 'C:\projects\tmp.CSV'
using (RemoteSource 'ODBC' Delimiter '|' SkipRows 1 MaxErrors 10 QuotedValue DOUBLE)
这是nzlog文件中的代码段
Found bad records
bad #: input row #(byte offset to last char examined) [field #, declaration] diagnostic,
"text consumed"[last char examined]
----------------------------------------------------------------------------------------
1: 2(0) [1, INT8] contents of field, ""[0x00<NUL>]
2: 3(0) [1, INT8] contents of field, ""[0x00<NUL>]
并且nzbad文件的每个字符之间都有“ NUL”。
我创建了一个前200万行的新文件。然后我在上面运行了iconv
iconv
使用相同的命令,新文件完美加载,没有错误。没有iconv -f UCS-2LE -t UTF-8 tmp.CSV > tmp_utf.CSV
转换,是否可以加载文件?运行iconv
需要很长时间。
[Netezza不支持UCS-2LE,为您着想,我希望UTF-8足以容纳您拥有的数据(没有古代语言或类似语言?]
您需要集中精力通过以下方式更快地完成转换: