Skip to content
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

Fix unsigned jdbc types #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

panbingkun
Copy link

@panbingkun panbingkun commented May 24, 2024

1.The pr aims to fix unsigned jdbc types, include:

  • UnsignedIntColumn from Types.BIGINT to Types.INTEGER
  • UnsignedSmallIntColumn from Types.INTEGER to Types.SMALLINT
  • UnsignedTinyIntColumn from Types.SMALLINT to Types.TINYINT

2.why?
When we recently migrated mariadb-connector-j from 2.x to 3.x in Spark and used mariadb-connector-j to access MySQL data, We found that 'java. sql.Types' returned by some unsigned jdbc types of '2.x ' and ' 3.x ' are inconsistent, as follows:

Column Type Define 2.x 3.x
TINYINT UNSIGNED Types.TINYINT Types.SMALLINT
SMALLINT UNSIGNE Types.SMALLINT Types.INTEGER
INT UNSIGNED Types.INTEGER Types.BIGINT
val dataType = resultSetMetaData.getColumnType(i)

3.The data type is generally determined by two attributes: ColumnType and isSigned

@panbingkun panbingkun marked this pull request as ready for review May 24, 2024 01:18
@panbingkun
Copy link
Author

panbingkun commented May 24, 2024

cc @rusher @vaintroub @massimosiani
In addition, this has been the case since the beginning of the 3.x version (eg: 3.0.3).
Please don't mind. I want to ask, is there any special consideration or is it a bug?

The pr of migration mariadb-connector-j corresponding to Spark is: apache/spark#46655

@panbingkun
Copy link
Author

also cc @yaooqinn @dongjoon-hyun

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.

1 participant