【发布时间】:2026-01-22 02:35:01
【问题描述】:
我有多个 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 文件的 sn-p
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 -f UCS-2LE -t UTF-8 tmp.CSV > tmp_utf.CSV
使用相同的命令可以完美加载新文件,没有错误。我有什么方法可以在没有iconv 转换的情况下加载文件?运行iconv 需要很长时间。
【问题讨论】: