[英]error of importing data from csv file to IBM netezza sql database
I need to import a csv file (122 GB, all fields are integer or string) to a table on IBM netezza sql database through Aginity Netteza workbench. 我需要通过Aginity Netteza工作台将csv文件(122 GB,所有字段均为整数或字符串)导入IBM netezza sql数据库上的表。
I have created the table with fields that names match with ones in the csv file. 我用名称与csv文件中的名称匹配的字段创建了表。
When I imported the data I got error: 导入数据时出现错误:
Unable to export the data to a file. Error: required option for internal format is not set: Compress
I am confused because I am doing import not export. 我很困惑,因为我正在做进口而不是出口。 This is my sql query:
这是我的SQL查询:
CREATE TABLE my_table
(
id integer ,
value1 integer ,
value2 character varying(2) ,
value3 integer ,
value4 character varying(32) ,
value5 integer ,
value6 double precision
);
INSERT INTO my_table
SELECT * FROM
EXTERNAL 'E:\\my_path\\my_file.csv'
USING
(
DELIMITER ','
LOGDIR 'C:\\my_log'
Y2BASE 2000
ENCODING 'internal'
SKIPROWS 1
REMOTESOURCE 'ODBC'
ESCAPECHAR '\'
)
Any help would be appreciated. 任何帮助,将不胜感激。
thanks 谢谢
This is a case of misleading error text, I think. 我认为这是一种误导性错误文本的情况。 If you are importing from a CSV then you should be using Text as the FORMAT.
如果要从CSV导入,则应使用“文本”作为“格式”。 It looks as if it is defaulting to 'internal' which is not what you want.
看起来好像默认为“内部”,这不是您想要的。 Try adding FORMAT 'text' to the USING section to explicitly state you are working with a text file.
尝试将FORMAT'text'添加到USING部分,以明确声明您正在使用文本文件。
INSERT INTO my_table
SELECT * FROM
EXTERNAL 'E:\\my_path\\my_file.csv'
USING
(
DELIMITER ','
LOGDIR 'C:\\my_log'
Y2BASE 2000
ENCODING 'internal'
SKIPROWS 1
REMOTESOURCE 'ODBC'
ESCAPECHAR '\'
FORMAT 'text'
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.