-
Notifications
You must be signed in to change notification settings - Fork 35
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
support SQLite's dynamic types #2728
Comments
Thanks for the report! We were definitely aware of this during development, and opted for the most strict solution possible to make is easier to relax semantics in the future if we needed to, and also to figure out what the right solution would be here. Unfortunately, for DataFusion-reasons, we have to know the schema of a table before we begin to operate on it, and so the operations are to:
For relational and strongly typed systems (Parquet, Lance, Postgres, MySQL, etc.) and including SQLite, we take the first option. For CSV, JSON, MongoDB and BSON, we take the second option (usually not the full data, but a sample, or the first I think the behavior we currently have is a good default, though I'm definitely open to providing alternate type-casting semantics (and am open to suggestions both about the default, and the kinds of logic that we use to type cast.) Things that we could do:
There are pros and cons to each, but I think having the strict-mode be the default, and relaxing the constraints optionally has some benefits. While I have you here, I'd also love to know what the use case/situation you have where you have SQLite tables with different types for the columns and values? I've probably been working in strongly/statically typed languages for long enough that I underestimated the prefelance of dynamic type use in SQLite... |
Ah ok, I see. Makes sense. |
SQLite essentially has dynamic typing. More on that here: https://www.sqlite.org/datatype3.html. Perhaps there is a solution where GlareDB can handle these cases more gracefully? At present, any value that differs from the column type affinity throws an error.
The text was updated successfully, but these errors were encountered: