-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add document for export_file
- Loading branch information
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. _export_file: | ||
|
||
==================== | ||
export_file operator | ||
==================== | ||
|
||
.. _export_file_operator: | ||
|
||
When to use the ``export_file`` operator | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
The ``export_file`` function writes SQL table to csv/parquet on local/S3/GCS. The ``export_file`` function imports data from :ref:`supported_databases` or pandas dataframe. | ||
|
||
There are two use cases of the ``export_file`` operator. | ||
|
||
|
||
Case 1: Export file from table. | ||
The following example saves your :ref:`table` of data to file storage using the ``export_file``, which returns a pointer to File object. | ||
|
||
.. literalinclude:: ../../../../example_dags/example_google_bigquery_gcs_load_and_save.py | ||
:language: python | ||
:start-after: [START export_example_1] | ||
:end-before: [END export_example_1] | ||
|
||
Case 2: Export file from dataframe. | ||
The following example saves your pandas dataframe of data to file storage using the ``aql.export_file``, which returns a pointer to File object. | ||
|
||
.. literalinclude:: ../../../../example_dags/example_google_bigquery_gcs_load_and_save.py | ||
:language: python | ||
:start-after: [START export_example_2] | ||
:end-before: [END export_example_2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters