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

Commit

Permalink
Merge pull request #892 from openedx/hassan/sqoop-fix-attempt-1
Browse files Browse the repository at this point in the history
fix: sqoop workaround for mysql 8.0
  • Loading branch information
HassanJaveed84 authored Nov 21, 2023
2 parents c0981cf + f6a217e commit fd025d6
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit fd025d6

Please sign in to comment.