vshshjn7 commented on a change in pull request #11318:
URL: https://github.com/apache/airflow/pull/11318#discussion_r501609745
##########
File path: airflow/providers/google/cloud/transfers/sql_to_gcs.py
##########
@@ -232,6 +232,10 @@ def _write_local_data_files(self, cursor):
return files_to_upload
+ def get_cursor_iterator(self, cursor):
Review comment:
As per pep-0249, `__iter__` is an optional dbapi extension. So, other
datastores also may or may not choose to implement this.
The above change will not change the existing functionality, rather will
give the flexibility to the user to define/modify the iterator if in case it is
not provided by the datastore cursor.
I am fine with making changes. Kindly let me know.
##########
File path: airflow/providers/google/cloud/transfers/sql_to_gcs.py
##########
@@ -232,6 +232,10 @@ def _write_local_data_files(self, cursor):
return files_to_upload
+ def get_cursor_iterator(self, cursor):
Review comment:
As per pep-0249, `__iter__` is an optional dbapi extension. So, other
datastores also may or may not choose to implement this.
The above change will not change the existing functionality, rather will
give the flexibility to the user to define/modify the iterator if in case it is
not provided by the datastore cursor.
I am fine with making changes, but I feel this gives more flexibility to the
user to modify or define iterator if he wants.
##########
File path: docs/howto/operator/google/transfer/vertica_to_gcs.rst
##########
@@ -0,0 +1,58 @@
+ .. 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.
+
+Vertica To Google Cloud Storage Operator
+========================================
+The `Google Cloud Storage <https://cloud.google.com/storage/>`__ (GCS) service
is
+used to store large data from various applications. This page shows how to copy
+data from Vertica to GCS.
+
+.. contents::
+ :depth: 1
+ :local:
+
+
+Prerequisite Tasks
+^^^^^^^^^^^^^^^^^^
+
+.. include::/howto/operator/google/_partials/prerequisite_tasks.rst
Review comment:
Why do we need to configure Vertica? Credentials and DB name are part of
the Airflow connection and the rest of the details are taken by the operator.
Are you talking about ``pip install 'apache-airflow[vertica]'`` ? Am I
missing something?
##########
File path: airflow/providers/google/cloud/transfers/vertica_to_gcs.py
##########
@@ -0,0 +1,106 @@
+# 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.
+
+import decimal
+
+import datetime
+import sys
+
+import time
+
+from airflow.providers.vertica.hooks.vertica import VerticaHook
+from airflow.providers.google.cloud.transfers.sql_to_gcs import
BaseSQLToGCSOperator
+from airflow.utils.decorators import apply_defaults
+
+PY3 = sys.version_info[0] == 3
+
+
+class VerticaToGoogleCloudStorageOperator(BaseSQLToGCSOperator):
Review comment:
+1
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]