From f6a217ee01eee7bf590ae017708f85201fb53989 Mon Sep 17 00:00:00 2001 From: Hassan Date: Mon, 30 Oct 2023 21:28:10 -0500 Subject: [PATCH] fix: sqoop workaround for mysql 8.0 --- edx/analytics/tasks/common/sqoop.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/edx/analytics/tasks/common/sqoop.py b/edx/analytics/tasks/common/sqoop.py index 5615603881..7c7c02638a 100644 --- a/edx/analytics/tasks/common/sqoop.py +++ b/edx/analytics/tasks/common/sqoop.py @@ -255,6 +255,18 @@ def import_args(self): arglist.append('--direct') if self.mysql_delimiters: arglist.append('--mysql-delimiters') + + # Sqoop adds --skip-opt by default, which in turn adds + # NO_FIELD_OPTIONS, NO_KEY_OPTIONS and NO_TABLE_OPTIONS to the sql_mode. + # MySQL 8.0 does not support these options and throws an error. + # Using --opt along with additional options to workaround this issue. + # https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-changes + arglist.append('--') + arglist.append('--opt') + arglist.append('--skip-disable-keys') + arglist.append('--skip-add-locks') + arglist.append('--skip-extended-insert') + return arglist def source_database_type(self):