blcksrx commented on a change in pull request #17974:
URL: https://github.com/apache/airflow/pull/17974#discussion_r702414445
##########
File path: airflow/hooks/dbapi.py
##########
@@ -286,11 +290,20 @@ def _generate_insert_sql(table, values, target_fields,
replace, **kwargs):
else:
target_fields = ''
- if not replace:
- sql = "INSERT INTO "
+ if not kwargs.get("before_statement"):
+ if not replace:
+ sql = "INSERT INTO "
+ else:
+ sql = "REPLACE INTO "
else:
- sql = "REPLACE INTO "
+ sql = (
+ kwargs.get("before_statement") + " "
+ ) # ensure that there is at least a white space after that
+
sql += f"{table} {target_fields} VALUES ({','.join(placeholders)})"
+ if kwargs.get("after_statement"):
+ sql += " " + kwargs.get("after_statement")
Review comment:
Oh, thanks for remarks. I will fix it
--
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]