-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 postgres types transparently in queries #6817
Comments
I think this would be very straightforward as long as the postgres type had a clear mapping to an Arrow type. For example int8 maps seemingly nicely to The mapping of SQL type to ArrowType is done here:
So we would just have to encode a listing of custom type names to arrow |
I think this is a good first issue as it is a substantial potential positive impact and relatively low complexity (add type aliases, update docs, write some tests) and would be a good way for someone to get started with DataFusion |
If the issue is not urgent I'm happy to take it, I think it's a good opportunity to learn about DataFusion 🤣 |
@alamb I'm not sure this is correct, as Int8 should map to BigInt, but in the example above it is SmallInt |
Thank you @comphead -- you are right, Thank you for https://www.postgresql.org/docs/current/datatype-numeric.html which is the definitive reference |
Is your feature request related to a problem or challenge?
DataFusion doesn't support native postgres types. I just realised that postgres queries that use postgres types, like the ones below, fail when executed against DataFusion. For example, the query below fails because the
int8
isn’t recognised.Describe the solution you'd like
Would be useful if type alisases were automatically supported without the user having to re-write postgres queries - e.g. int8 -> bigint and int4 -> int, etc.
Describe alternatives you've considered
Other databases support type aliases, I don't know how easy it is to implement that in DataFusion - https://duckdb.org/docs/sql/data_types/overview
Additional context
No response
The text was updated successfully, but these errors were encountered: