ashb commented on a change in pull request #6822: [AIRFLOW-5616] Refactor
presto hook to support transactions.
URL: https://github.com/apache/airflow/pull/6822#discussion_r358125624
##########
File path: airflow/hooks/presto_hook.py
##########
@@ -134,5 +134,17 @@ def insert_rows(self, table, rows, target_fields=None):
:type rows: iterable of tuples
:param target_fields: The names of the columns to fill in the table
:type target_fields: iterable of strings
+ :param commit_every: The maximum number of rows to insert in one
+ transaction. Set to 0 to insert all rows in one transaction.
+ :type commit_every: int
"""
- super().insert_rows(table, rows, target_fields, 0)
+ with closing(self.get_conn()) as conn:
+ if conn.isolation_level == 0:
Review comment:
That said it seems expensive to get a connection just to check this setting
-- is there some way of doing this the doesn't invovle opening a connection,
checking this setting, throwing it away and then opening it again in the
`super()` call?
----------------------------------------------------------------
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]
With regards,
Apache Git Services