timsants
timsants

Reputation: 1

Bulk unloading Snowflake data through JDBC vs COPY_INTO + GET

I'm interested in continuously bulk unloading data from Snowflake to a local storage. Are there any drawbacks to bulk unload from Snowflake by directly issuing a SELECT query using JDBC vs using COPY_INTO to copy to a Snowflake internal stage and then using the GET command to download from internal stage (Snowflake reference).

Making a select query through JDBC seems more direct without having to use Snowflake storage capacity of the intermediate internal stage.

Upvotes: 0

Views: 469

Answers (1)

Eric Lin
Eric Lin

Reputation: 1520

COPY INTO has some extra benefits that direct SELECT does not have:

  1. Format options, which allows you to generate other file types other than CSV, like JSON, Parquet, AVRO, ORC and XML
  2. You can copy directly to an external location, like S3
  3. You can control whether to generate single or multiple files and define max file size per file
  4. You can control delimiter, field enclosure and escape characters etc
  5. You can decide what compression to use, it supports GZIP, BZ2 etc

This is not an exhaustive list, so I think COPY INTO gives you more control over simple direct SELECT.

Upvotes: 0

Related Questions