-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enum type added to the types metadata table #5290
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks good. Some comments:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Lindsay, many thanks for the PR, it looks great!
Out of curiosity, I see that 'ENUM' becomes an invalid name for an enum, is it only on caps, or 'enum'/'EnUm' are also now invalid?
(I don't even remember if we are case sensitive for enum types although I implemented that (: )
it's case insensitive, enum has been added to the catalog and is now like a reserved typename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! Looks great.
cc @saulpw, looks like we can properly support this in ibis now! |
Looking forward to testing this 😁 |
Doesn't look like this is working as expected quite just yet, I'm looking into it |
Looks like
duckdb/src/function/table/system/duckdb_types.cpp Lines 85 to 98 in 9cfe9c4
|
I suggest to make this into a separate issue, because I suspect more of these system tables will require similar additions to fully support enums. |
Sounds likely yes |
Rewrite the pattern LIST(x ORDER BY x <ordering>) as LIST_SORT(LIST(x), <ordering>). This reduces the included benchmark run time from 23.5s to 4.32s.
Add missing include for tidy.
Correct benchmark description.
Add more strings to EnumSerializer so LIST_SORT can use it for parsing.
Issue #5290: Rewrite ordered LIST
This pr addresses issue #5174 and offers an alternative solution.
@Mause suggested to output an additional field in the underlying table (duckdb_types) instead, which the pg_... view consumes to provide a postgres compatible interface and therefore compatible with SQLAlchemy. So I’ve added the enum type to duckdb_types.
14 nov. additions:
The pg_enum view now shows the metadata of enum types similar to Postgres. To get the enum data for this view, I have added an extra column to the duckdb_types table containing the possible values of each enum type.
Some small changes in the format_pg_type function and pg_type view were also required to make this functionality resemble the Postgres results as much as possible.