-
Notifications
You must be signed in to change notification settings - Fork 20
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
Issue 321: Pre-commit hook #319
Conversation
What's the issue number describing what issue this is resolving? |
There's none. I will open one 👍 |
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.
Few comments on the code:
The code seems ready to review, but we will need to provide a better description of the feature, alongside logging and documentation. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 91.32% 91.44% +0.11%
==========================================
Files 98 99 +1
Lines 2652 2688 +36
Branches 343 338 -5
==========================================
+ Hits 2422 2458 +36
Misses 230 230 ☔ View full report in Codecov by Sentry. |
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.
In general looks very good!! Just a few things on documentation/options..
Pre-commit Hooks
This PR introduces pre-commit hooks for the qbeast format, which enables the execution of custom code just before a write or optimization is committed. More details are described in Issue #321.
Fixes #321 and #323
The hook should extend
io.qbeast.spark.delta.hook.PreCommitHook,
overriding therun
method, which has access to the sequence ofAction
s created by the operation. The same method returns aMap[String, String],
which will be used astags
for the transaction'sCommitInfo
.Hooks for Writes:
myHook1
, andmyHook2.
qbeastPreCommitHook.<custom-hook-name>.
qbeastPreCommitHook.<custom-hook-name>.arg
for the ones that take initiation arguments. Currently, only one String argument is allowed for each hook.Hooks for Optimizations:
Example:
SimpleHook
cat /tmp/test/_delta_log/00000000000000000000.json | jq