Skip to content

CDAP-17330 Handle TINYINT in mysql.#99

Merged
sagarkapare merged 1 commit intodevelopfrom
bugfix/CDAP-17330-handle-tinyint
Nov 11, 2020
Merged

CDAP-17330 Handle TINYINT in mysql.#99
sagarkapare merged 1 commit intodevelopfrom
bugfix/CDAP-17330-handle-tinyint

Conversation

@sagarkapare
Copy link
Copy Markdown
Contributor

https://issues.cask.co/browse/CDAP-17330

Debezium mysql connector converts TINYINT datatype in mysql to Short which does not have corresponding CDAP/Avro Schema type. Converting TINYINT to the INT Type.

case FLOAT32:
case FLOAT64:
return val;
case INT16:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about INT8?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the database type for mysql or sql server type is actually converted to INT8 by debezium. 1. https://debezium.io/documentation/reference/1.3/connectors/mysql.html#how-the-mysql-connector-maps-data-types_debezium
2. https://debezium.io/documentation/reference/1.3/connectors/sqlserver.html#sqlserver-data-types. We can get rid of it in separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the information, Sagar. I guess we'd better not get rid of it, since here it's not related to any specific DB source. For example, if later we want to support Other DB source also through Debezium which will have datatype converted to INT8, it will be hard for us to remember there is hole to fill here.

@Test
public void testConvert() {
String fieldName = "priority";
Schema dateSchema = SchemaBuilder.struct().name("TinyIntSchema").field(fieldName, Schema.INT16_SCHEMA).build();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do you mean dataSchema ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah :) fixed.

Copy link
Copy Markdown
Contributor

@seanzhougoogle seanzhougoogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you Sagar:)

@sagarkapare sagarkapare force-pushed the bugfix/CDAP-17330-handle-tinyint branch from 7634efe to 974797d Compare November 11, 2020 18:20
@sagarkapare sagarkapare merged commit 4130c45 into develop Nov 11, 2020
@sagarkapare sagarkapare deleted the bugfix/CDAP-17330-handle-tinyint branch November 11, 2020 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants