【问题标题】:Snowflake Not Accepting File Format In Bulk Load雪花不接受批量加载的文件格式
【发布时间】:2020-04-08 07:55:45
【问题描述】:

我正在为我们的数据管道创建一些新的 ETL 任务。我们目前有数百个来自各种 S3 存储桶的加载数据。

所以它会是这样的:

create or replace stage ETL_STAGE url='s3://bucketname/'
  file_format = csv_etl;

create or replace file format csv_etl
  type = 'CSV'
  field_delimiter = ','
  skip_header = 1
  FIELD_OPTIONALLY_ENCLOSED_BY='"'

copy into db.schema.table
  from @ETL_STAGE/Usage
  pattern='/.*[.]csv'
  on_error = 'continue'

但是,每当我使用它时,我的文件格式不仅没有转义封闭的双引号,甚至没有跳过标题,所以我得到了这个:

对此感到非常困惑,因为我 99% 确定此处的格式选项是正确的。

+-------------------+----------+----------------+---------------------+-------------------+
| "Usage Task Name" |  "Value" |  "etl_uuid"    | "etl_deviceServer"  |  "etl_timestamp"  |
| "taskname"        |  "0"     | "adfasdfasdf"  | "hostserverip"      | "2020-04-06 2124" |
+-------------------+----------+----------------+---------------------+-------------------+

【问题讨论】:

    标签: etl snowflake-schema snowflake-task


    【解决方案1】:

    通过包含 file_format 运行以下命令。这在加载文件时应用了文件格式:

      copy into db.schema.table
      from @ETL_STAGE/Usage
      pattern='/.*[.]csv'
      on_error = 'continue'
      file_format = csv_etl;
    

    【讨论】:

    • 但为什么不在舞台层面呢?
    猜你喜欢
    • 2020-06-05
    • 2020-07-14
    • 1970-01-01
    • 2021-12-24
    • 1970-01-01
    • 2017-07-26
    • 2020-09-27
    • 2021-09-03
    • 1970-01-01
    相关资源
    最近更新 更多