Skip to content

Added support for BIGINT UNSIGNED type in MySQL and MariaDB DBTypes#1735

Open
AndreiKingsley wants to merge 6 commits intomasterfrom
fix_jdbc_types
Open

Added support for BIGINT UNSIGNED type in MySQL and MariaDB DBTypes#1735
AndreiKingsley wants to merge 6 commits intomasterfrom
fix_jdbc_types

Conversation

@AndreiKingsley
Copy link
Collaborator

Fixes #762.

@Jolanrensen
Copy link
Collaborator

Jolanrensen commented Mar 10, 2026

could you add tests for this specific fix? :)

(the build should not have failed, I'll rerun)
(okay, maybe rebase on master, I've limited the maven logs, they were getting way too large)

@AndreiKingsley
Copy link
Collaborator Author

AndreiKingsley commented Mar 11, 2026

@Jolanrensen added tests as an initiating of #1736.

@Jolanrensen
Copy link
Collaborator

@AndreiKingsley that's good :) though, I would also recommend running a test with the actual database, like here https://github.com/Kotlin/dataframe/blob/c3742a95684d53a813d978a3c895090ba684c46e/dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/local/mysqlTest.kt (though, you'd need to set up a local database for that. Just ask Junie to do that for you ;P, I think @zaleslaw would appreciate it :) )

@AndreiKingsley
Copy link
Collaborator Author

@Jolanrensen , added BIGINT UNSIGNED columns to Genereal MariaDB / MySQL tests!

class MariaDBTypes {

object BIGINT_UNSIGNED : ColumnType(
"BIGINT UNSIGNED",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend using named arguments. Makes refactoring easier :)

val javaClassName: String,
val expectedKotlinType: KType,
) {
fun mockkColMetaData() =
Copy link
Collaborator

Choose a reason for hiding this comment

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

since when does "mock" have 2 k's? ;P

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh and "metadata" is one word, so it would become: "mockColMetadata()"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I often use MockK variables usually called mockk.. 😆

jdbcType,
10,
javaClassName,
false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm by setting this to false always, you might not catch the cases where someone forgets to take care about nullability (which is an easy mistake to make). Maybe we should test both isNullable and !isNullable. This could also be done in a next pr of course


object BIGINT_UNSIGNED : ColumnType(
"BIGINT UNSIGNED",
20,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd use Sql.Types for this

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, it doesn't exist?... interesting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, it's a MySQL/MariaDB specific type.

Copy link
Collaborator

Choose a reason for hiding this comment

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

classic

@AndreiKingsley AndreiKingsley requested a review from zaleslaw March 16, 2026 13:09
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.

DataFrame fails on simple actions with casting BigInteger to Long

2 participants