-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add MySQL DataType handler to transform datatype value #5165
Conversation
Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
Signed-off-by: Dinu John <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design looks nice! Thanks for working on this.
A few small comments/questions below:
...c/main/java/org/opensearch/dataprepper/plugins/source/rds/datatype/impl/JsonTypeHandler.java
Outdated
Show resolved
Hide resolved
return handleNumericType(columnType, (Number) value); | ||
} | ||
|
||
private String handleNumericType(final MySQLDataType columnType, final Number value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we converting all numeric types to String type here? For numbers that OpenSearch supports, should we keep them as numbers?
...main/java/org/opensearch/dataprepper/plugins/source/rds/datatype/impl/StringTypeHandler.java
Outdated
Show resolved
Hide resolved
VARCHAR("varchar", DataCategory.STRING, DataSubCategory.CHAR), | ||
TINYTEXT("tinytext", DataCategory.STRING, DataSubCategory.BYTES), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering what's the difference between CHAR and BYTES sub category. Are they represented differently in binlog events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The once tagged with DataSubCategory.BYTES
the value is encoded in bytes in binlogs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is VARCHAR encoded in bytes in binlog as well, or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, CHAR and VARCHAR are not encoded in bytes
Signed-off-by: Dinu John <[email protected]>
Description
This PR introduces a DataType handling system to properly transform MySQL data types from binary format to their corresponding string representations. This is essential for both change stream processing and parquet file export processing where data from events may be encoded in bytes.
Some handler implementation are stubbed. Will add follow up PR when they are tested with correct implementation.
Issues Resolved
Contributes to #4561
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.