Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

fix: sqoop workaround for mysql 8.0 #892

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions edx/analytics/tasks/common/sqoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading