-
Notifications
You must be signed in to change notification settings - Fork 4.6k
🐛 Normalization: Fix sync from HubSpot to MySQL fails with "Row size too large" on create table #10485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Normalization: Fix sync from HubSpot to MySQL fails with "Row size too large" on create table #10485
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -516,6 +516,8 @@ def cast_property_type(self, property_name: str, column_name: str, jinja_column: | |
return f"parseDateTime64BestEffortOrNull(trim(BOTH '\"' from {replace_operation})) as {column_name}" | ||
# in all other cases | ||
sql_type = jinja_call("type_timestamp_with_timezone()") | ||
if self.destination_type == DestinationType.MYSQL: | ||
sql_type = f"{sql_type}(1024)" | ||
return f"cast({replace_operation} as {sql_type}) as {column_name}" | ||
elif is_date(definition): | ||
if self.destination_type.value == DestinationType.MYSQL.value: | ||
|
@@ -538,6 +540,9 @@ def cast_property_type(self, property_name: str, column_name: str, jinja_column: | |
trimmed_column_name = f"trim(BOTH '\"' from {column_name})" | ||
sql_type = f"'{sql_type}'" | ||
return f"nullif(accurateCastOrNull({trimmed_column_name}, {sql_type}), 'null') as {column_name}" | ||
elif self.destination_type == DestinationType.MYSQL: | ||
# Cast to `text` datatype. See https://github.com/airbytehq/airbyte/issues/7994 | ||
sql_type = f"{sql_type}(1024)" | ||
Comment on lines
+543
to
+545
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The proper way of changing a datatype for a certain destination should be done in dbt macros, not directly in the python code: see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be causing this error? Failure Origin: normalization, Message: Normalization failed during the dbt run. This may indicate a problem with the data itself. 1292 (22007): Truncated incorrect CHAR(1024) value: |
||
else: | ||
print(f"WARN: Unknown type {definition['type']} for column {property_name} at {self.current_json_path()}") | ||
return column_name | ||
|
Uh oh!
There was an error while loading. Please reload this page.