Repository navigation
🎉 Source MySQL: support all MySQL 8.0 types - #7970
Conversation
Sherif A. Nada (sherifnada)
left a comment
There was a problem hiding this comment.
I like it! Great direction
cf5e44f to
3f675b2
Compare
809be96 to
55a5499
Compare
|
Sherif A. Nada (@sherifnada), Eugene (@etsybaev), Andrii Leonets (@DoNotPanicUA), this PR is ready for review. Would you mind taking a look? |
Eugene (etsybaev)
left a comment
There was a problem hiding this comment.
This looks quite impressive!
| * fail it, so it is turned off by default. It should be enabled for all databases eventually. | ||
| */ | ||
| protected boolean testCatalog() { | ||
| return false; |
There was a problem hiding this comment.
Is that expected to be committed or just accidentally forgotten?
There was a problem hiding this comment.
same comment
There was a problem hiding this comment.
This is expected. See the comment for the rationale. We need to check each database because we can turn it on by default.
| * fail it, so it is turned off by default. It should be enabled for all databases eventually. | ||
| */ | ||
| protected boolean testCatalog() { | ||
| return false; |
There was a problem hiding this comment.
same comment
| } | ||
|
|
||
| @Override | ||
| protected JdbcSourceOperations getSourceOperations() { |
There was a problem hiding this comment.
how come this was removed? is the class still useful?
There was a problem hiding this comment.
This method is unnecessary. The sourceOperations is an instance variable, and it is assigned in the constructor. The AbstractJdbcSource can just reference that variable.
| case TIME -> putTime(json, columnName, resultSet, colIndex); | ||
| // The returned year value can either be a java.sql.Short (when yearIsDateType=false) | ||
| // or a java.sql.Date with the date set to January 1st, at midnight (when yearIsDateType=true). | ||
| // Currently, JsonSchemaPrimitive does not support integer, but only supports number. |
There was a problem hiding this comment.
seems like fixing up jsonSchemaPrimitive is high up on the list of things to fix also?
| * does not contain information about its charset, which is needed to determine whether the column | ||
| * is a string or binary. We don't distinguish between string vs binary in | ||
| * {@link JsonSchemaPrimitive} for now. So it is fine. However, in the future, if we want to | ||
| * separate these two types, we need to update the column metadata query for MySQL. See |
There was a problem hiding this comment.
should we have an issue for this?
There was a problem hiding this comment.
Actually JDBC does return BINARY for CHAR columns with binary character set. Same for VARCHAR. So this is a false alarm.
| .fullSourceDataType("varchar(256) character set cp1251") | ||
| .addInsertValues("null", "'тест'") | ||
| .addExpectedValues(null, "тест") | ||
| // MySQL converts values in the ranges '0' - '69' to YEAR value in the range 2000 - 2069 |
There was a problem hiding this comment.
what on earth...
|
/test connector=connectors/source-mysql
|
|
/test connector=connectors/source-mysql
|
|
/publish connector=connectors/source-mysql
|
* Add jdbc compatible layer * Support routine mysql types * Format code * Fix build * Refactor abstract jdbc source and operation classes * Update mysql source operations * Test discover command for mysql * Remove abstract jdbc compatible source layer * Format code * Update template * Fix more types * Bump version * Log original field type * Update comments * Bump version in seed
What
0.5.0.How
AbstractJdbcSourceis changed to a generic class.JdbcCompatibleSourceOperationsinterface is added that extends fromSourceOperations. It has more interface methods to be used inAbstractJdbcSource.JdbcSourceOperationsis broken into two classes:AbstractJdbcCompatibleSourceOperationshas most of the original logics with generic types.JdbcSourceOperationsextends fromAbstractJdbcCompatibleSourceOperationswith theJDBCTypes.MySqlSourceOperationsextends fromAbstractJdbcCompatibleSourceOperationswith theMysqlType.TODOs
MysqlTypein all methods.Recommended reading order
MySqlSourceOperations.javaPre-Merge Checklist - Updating Connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing./publishcommand described here