-
Notifications
You must be signed in to change notification settings - Fork 68
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
Handle exceptions caused by partitioned tables #412
Conversation
…nstead of DuckDB. This temporarily avoids the unavailability of the system due to an assertion.
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.
Thank you for the fix. Some small naming suggestions, but other than that this looks good.
src/pgduckdb_hooks.cpp
Outdated
@@ -52,6 +52,23 @@ IsCatalogTable(List *tables) { | |||
return false; | |||
} | |||
|
|||
static bool | |||
IsPartitionedTable(List *tables) { |
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.
I think Is
is the wrong prefix here and the argument name tables
is also confusing. We pass it a list of tables RTEs not a single table. I realize the problem is the case for IsCatalogTable
, but we should change this there too (not in this PR though).
IsPartitionedTable(List *tables) { | |
ContainsPartitionedTable(List *rtes) { |
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.
Updated the IsCatalogTable function information #417
src/pgduckdb_hooks.cpp
Outdated
IsPartitionedTable(List *tables) { | ||
foreach_node(RangeTblEntry, table, tables) { | ||
if (table->rtekind == RTE_SUBQUERY) { | ||
/* Check whether the table in the subquery is a partitioned table */ |
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.
/* Check whether the table in the subquery is a partitioned table */ | |
/* Check whether any table in the subquery is a partitioned table */ |
Because we do not yet have good support for partitioned tables, the following code triggers assertions. #409
What does this PR do?
When accessing the partition table, we temporarily let PG handle it instead of DuckDB.
This temporarily avoids the unavailability of the system due to an assertion.