将CSV加载到Redshift中,带标题?

时间:2022-03-04 23:04:53

Is there an option to load a CSV into Redshift with a header? I see the documentation for CSV but it says nothing about a header. Ideally it could use the header to determine the columns to load.

是否可以选择使用标题将CSV加载到Redshift中?我看到了CSV的文档,但它没有说明标题。理想情况下,它可以使用标头来确定要加载的列。

1 个解决方案

#1


29  

Use the IGNOREHEADER 1 option when using the COPY command:

使用COPY命令时,请使用IGNOREHEADER 1选项:

IGNOREHEADER [ AS ] number_rows

IGNOREHEADER [AS] number_rows

Treats the specified number_rows as a file header and does not load them. Use IGNOREHEADER to skip file headers in all files in a parallel load.

将指定的number_rows视为文件头,但不加载它们。使用IGNOREHEADER跳过并行加载中所有文件中的文件头。

See: Amazon Redshift COPY command documentation

请参阅:Amazon Redshift COPY命令文档

#1


29  

Use the IGNOREHEADER 1 option when using the COPY command:

使用COPY命令时,请使用IGNOREHEADER 1选项:

IGNOREHEADER [ AS ] number_rows

IGNOREHEADER [AS] number_rows

Treats the specified number_rows as a file header and does not load them. Use IGNOREHEADER to skip file headers in all files in a parallel load.

将指定的number_rows视为文件头,但不加载它们。使用IGNOREHEADER跳过并行加载中所有文件中的文件头。

See: Amazon Redshift COPY command documentation

请参阅:Amazon Redshift COPY命令文档