|
17 | 17 |
|
18 | 18 | .. _howto/operator:S3ToSnowflakeOperator:
|
19 | 19 |
|
20 |
| -S3ToSnowflakeOperator |
21 |
| -===================== |
| 20 | +CopyFromExternalStageToSnowflakeOperator |
| 21 | +======================================== |
22 | 22 |
|
23 |
| -Use the :class:`S3ToSnowflakeOperator <airflow.providers.snowflake.transfers.s3_to_snowflake>` to load data stored in `AWS S3 <https://aws.amazon.com/s3/>`__ |
24 |
| -to a Snowflake table. |
| 23 | +Use the :class:`CopyFromExternalStageToSnowflakeOperator <airflow.providers.snowflake.transfers.copy_into_snowflake>` |
| 24 | +to load data stored in `AWS S3 <https://aws.amazon.com/s3/>`__, |
| 25 | +`Google Cloud Storage <https://cloud.google.com/storage>`__, or |
| 26 | +`Azure Blob Storage <https://azure.microsoft.com/products/storage/blobs>`__ to a Snowflake table. |
25 | 27 |
|
| 28 | +.. note:: This operator is a simple wrapper in top of |
| 29 | + `COPY INTO table <https://docs.snowflake.com/en/sql-reference/sql/copy-into-table#>`__ query, and |
| 30 | + required `creating stage <https://docs.snowflake.com/en/sql-reference/sql/create-stage>`__ first. |
26 | 31 |
|
27 | 32 | Using the Operator
|
28 | 33 | ^^^^^^^^^^^^^^^^^^
|
29 | 34 |
|
30 | 35 | Similarly to the :class:`SnowflakeOperator <airflow.providers.snowflake.operators.snowflake>`, use the ``snowflake_conn_id`` and
|
31 | 36 | the additional relevant parameters to establish connection with your Snowflake instance.
|
32 | 37 | This operator will allow loading of one or more named files from a specific Snowflake stage (predefined S3 path). In order to do so
|
33 |
| -pass the relevant file names to the ``s3_keys`` parameter and the relevant Snowflake stage to the ``stage`` parameter. |
| 38 | +pass the relevant file names to the ``files`` parameter and the relevant Snowflake stage to the ``stage`` parameter. |
34 | 39 | ``pattern`` can be used to specify the file names and/or paths match patterns
|
35 | 40 | (see `docs <https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#loading-using-pattern-matching>`__).
|
36 | 41 | ``file_format`` can be used to either reference an already existing Snowflake file format or a custom string that defines
|
37 | 42 | a file format (see `docs <https://docs.snowflake.com/en/sql-reference/sql/create-file-format.html>`__).
|
38 | 43 |
|
39 |
| -An example usage of the S3ToSnowflakeOperator is as follows: |
| 44 | +An example usage of the CopyFromExternalStageToSnowflakeOperator is as follows: |
40 | 45 |
|
41 |
| -.. exampleinclude:: /../../tests/system/providers/snowflake/example_s3_to_snowflake.py |
| 46 | +.. exampleinclude:: /../../tests/system/providers/snowflake/example_copy_into_snowflake.py |
42 | 47 | :language: python
|
43 |
| - :start-after: [START howto_operator_s3_to_snowflake] |
44 |
| - :end-before: [END howto_operator_s3_to_snowflake] |
| 48 | + :start-after: [START howto_operator_s3_copy_into_snowflake] |
| 49 | + :end-before: [END howto_operator_s3_copy_into_snowflake] |
45 | 50 | :dedent: 4
|
0 commit comments