【问题标题】:Sorting of partitioned data in snowflake copy into commandSorting of partitioned data in snowflake copy into command
【发布时间】:2022-12-01 21:09:30
【问题描述】:

I have a copy into command which unloads data from snowflake to a stage in parquet files. We are partitioning the data by one columns as well. Is it possible to sort the partitioned data by some column value.??

sample query:

copy into @Stage/data from (select deptid, ename, salary from employees order by ename) partition by (deptid) HEADER=true

Sorting by partition by column.

【问题讨论】:

    标签: snowflake-cloud-data-platform snowflake-schema


    【解决方案1】:

    Yes, it is technically possible to run the query, however, based on the Snowflake documentation there is no guarantee that the order of the data loaded using PARTITION BY and ORDER BY will be kept for the unloaded files.

    See the note below in the Snowflake docs:Including the ORDER BY clause in the SQL statement in combination with PARTITION BY does not guarantee that the specified order is preserved in the unloaded files.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-02
      • 2021-11-23
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-04
      • 2022-11-20
      • 2022-12-27
      相关资源
      最近更新 更多