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

ClassCast exception when reading from specific sqlite db #964

Open
koperagen opened this issue Nov 25, 2024 · 2 comments
Open

ClassCast exception when reading from specific sqlite db #964

koperagen opened this issue Nov 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working databases JDBC related issues
Milestone

Comments

@koperagen
Copy link
Collaborator

koperagen commented Nov 25, 2024

Firefox places db uses some weird column type that is not standard and not supported by xerial sqlite driver: LONGVARCHAR (https://sqlalchemy.narkive.com/DEL4O0EK/longvarchar). There's also a problem with driver being unable to tell if INTEGER column actually stores Long values
As a result, we have

  1. DataColumn with type = BigDecimal?, and values are all String? values
  2. DataColumn with type = Int?, and values are all Long? values
    Codegen in notebooks uses type to generate extension properties, and when you use them - you get ClassCast exception
class java.lang.String cannot be cast to class java.math.BigDecimal (java.lang.String and java.math.BigDecimal are in module java.base of loader 'bootstrap')
@koperagen koperagen added the bug Something isn't working label Nov 25, 2024
@zaleslaw zaleslaw self-assigned this Nov 25, 2024
@zaleslaw zaleslaw added this to the 0.16.0 milestone Nov 25, 2024
@zaleslaw zaleslaw added the databases JDBC related issues label Nov 25, 2024
@Jolanrensen
Copy link
Collaborator

This is exactly what the debug mode can catch.
If you set kotlin.dataframe.debug=true in gradle.properties and make a test with the given data, you can see where the values come from and are converted. Runtime class cast exceptions should not occur if the code works with debug mode enabled.

That said, a more helpful exception message would be great :)

@koperagen
Copy link
Collaborator Author

I know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working databases JDBC related issues
Projects
None yet
Development

No branches or pull requests

3 participants