-
Notifications
You must be signed in to change notification settings - Fork 12
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
Check extension at hooks #85
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.
(nvm old comment, needed to redo shared_preload_libraries)
src/parquet_copy_hook/copy_utils.rs
Outdated
} | ||
|
||
pub(crate) fn is_copy_from_parquet_stmt(p_stmt: &PgBox<PlannedStmt>) -> bool { | ||
// the GUC pg_parquet.enable_copy_hook must be set to true | ||
if !ENABLE_PARQUET_COPY_HOOK.get() { |
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, this looks a bit cleaner
src/parquet_copy_hook/copy_utils.rs
Outdated
|
||
// extension checks are done via catalog (not yet searched via cache by postgres till pg18) | ||
// this is why we check them after the uri checks | ||
extension_exists("pg_parquet") && !extension_exists("crunchy_query_engine") |
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.
thinking out loud: maybe we return silently if crunchy_query_engine exists, but throw a warning/notice if pg_parquet does not exist?
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.
makes sense
src/parquet_copy_hook/copy_utils.rs
Outdated
|
||
if !copy_stmt.is_from { | ||
// crunchy_query_engine should not be created | ||
if extension_exists("crunchy_query_engine") { |
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.
if this is the case, we want pg_parquet to be silent (should come before)
3f4ce54
to
199c832
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
- Coverage 92.18% 92.11% -0.08%
==========================================
Files 71 71
Lines 9087 9104 +17
==========================================
+ Hits 8377 8386 +9
- Misses 710 718 +8 ☔ View full report in Codecov by Sentry. |
It might be confusing for some users that hooks are still running (since at shared_preload_libraries) even if the extension is dropped. Hence, we decided to process parquet copy hooks only when
pg_parquet
extension is created.