Brooke-white commented on a change in pull request #18447: URL: https://github.com/apache/airflow/pull/18447#discussion_r719644330
########## File path: docs/apache-airflow-providers-amazon/operators/redshift.rst ########## @@ -0,0 +1,96 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _howto/operator:RedshiftSqlOperator: + +RedshiftSqlOperator +=================== + +.. contents:: + :depth: 1 + :local: + +Overview +-------- + +Use the :class:`RedshiftSqlOperator <airflow.providers.amazon.aws.operators.redshift>` to execute +statements against an Amazon Redshift cluster. + +:class:`RedshiftSqlOperator <airflow.providers.amazon.aws.operators.redshift.RedshiftSqlOperator>` works together with +:class:`RedshiftSqlHook <airflow.providers.amazon.aws.hooks.redshift.RedshiftSqlHook>` to establish +connections with Amazon Redshift. + + +example_redshift.py +------------------- + +Purpose +""""""" + +This is a basic example dag for using :class:`RedshiftSqlOperator <airflow.providers.amazon.aws.operators.redshift>` +to execute statements against an Amazon Redshift cluster. + +Create a table +"""""""""""""" + +In the following code we are creating a table called "fruit". + +.. exampleinclude:: /../../airflow/providers/amazon/aws/example_dags/example_redshift.py + :language: python + :start-after: [START howto_operator_redshift_create_table] + :end-before: [END howto_operator_redshift_create_table] + +Insert data into a table +"""""""""""""""""""""""" + +In the following code we insert a few sample rows into the "fruit" table. + +.. exampleinclude:: /../../airflow/providers/amazon/aws/example_dags/example_redshift.py + :language: python + :start-after: [START howto_operator_redshift_populate_table] + :end-before: [END howto_operator_redshift_populate_table] + +Fetching records from a table +""""""""""""""""""""""""""""" + +Retrieving all records from the "fruit" table. Review comment: thanks for the perspective. I agree this is confusing as written. I've reworked to use `create table my_table AS select *` as suggested. 1fd4ad631b24d6407c7d702176385b098d9584f9 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
