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

Switch SingleStore (memsql) JDBC driver from MariaDB to official driver #10669

Closed
jhlodin opened this issue Jan 18, 2022 · 5 comments · Fixed by #11301
Closed

Switch SingleStore (memsql) JDBC driver from MariaDB to official driver #10669

jhlodin opened this issue Jan 18, 2022 · 5 comments · Fixed by #11301

Comments

@jhlodin
Copy link
Contributor

jhlodin commented Jan 18, 2022

See memsql plugin:

<groupId>org.mariadb.jdbc</groupId>

Currently we package the MariaDB JDBC driver to connect to SingleStore, but there is now an official SingleStore JDBC driver.

@findepi @ebyhr Any insight as to why we use the MariaDB driver or otherwise if this is something worth doing?

@ebyhr
Copy link
Member

ebyhr commented Jan 19, 2022

The reason is there was no such dedicated JDBC driver when we introduced the connector. It worth switching the driver if it's stable and the license is fine.

@leveyja
Copy link
Member

leveyja commented Feb 28, 2022

TestMemSqlTypeMapping.testUnsignedTypes() is failing with the SingleStore driver. I'll investigate and see if we need a code change to support it (or if the driver needs a fix itself). Thanks for mentioning it @ebyhr ! 👍

2022-02-28T02:54:30.690-0600 SEVERE Error processing Split 20220228_085430_00322_4ysf7.1.0.0-0 io.trino.plugin.jdbc.JdbcSplit@41161598 (start = 1899250.09428, wall = 23 ms, cpu = 0 ms, wait = 0 ms, calls = 1): JDBC_ERROR: byte overflow
io.trino.spi.TrinoException: byte overflow
	at io.trino.plugin.jdbc.JdbcRecordCursor.handleSqlException(JdbcRecordCursor.java:299)

@leveyja
Copy link
Member

leveyja commented Feb 28, 2022

There is a bug in the field decoding in v1.0.0 and v.1.0.1 of the new SingleStore driver.
0.1.0-preview release of SingleStore doesn't have the issue. I'm investigating how to file a bug or submit a fix to their repo: https://github.com/memsql/S2-JDBC-Connector/releases - but until then this looks like a blocker for switching (and slightly worrying).

@ebyhr
Copy link
Member

ebyhr commented Feb 28, 2022

@leveyja You can handle the byte overflow by fixing MemSqlClient.getUnsignedMapping(). The typeHandle.getJdbcTypeName() contains precisions after the upgrade likes tinyint(3) unsigned

@leveyja
Copy link
Member

leveyja commented Feb 28, 2022

Thank you! I was in MemSqlClient trying to determine how/why it worked in 0.1.0-preview versus 1.0.0/1.0.1.
That's exactly the issue - name is now "TINTINT(3) UNSIGNED", not "TINYINT UNSIGNED".
Should be straight-forward (ish) to fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants