feat(sparksql): support bitmap_bit_position - #815
Open
felix-windsor wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds native Spark SQL support for Spark 3.5’s bitmap_bit_position(BIGINT) -> BIGINT, enabling bitmap aggregation pipelines to execute the scalar step in Bolt instead of falling back to Spark.
Changes:
- Implemented
BitmapBitPositionFunctionwith Spark-compatible semantics, including safe handling ofINT64_MIN. - Registered
bitmap_bit_positionin the Spark SQL function registry. - Added unit tests covering positive, non-positive, NULL, and casted inputs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bolt/functions/sparksql/tests/CMakeLists.txt | Adds the new bitmap scalar function test file to the Spark SQL test target. |
| bolt/functions/sparksql/tests/BitmapTest.cpp | New unit tests validating bitmap_bit_position behavior across edge cases. |
| bolt/functions/sparksql/registration/RegisterBitmap.cpp | Registers the new scalar function with the Spark SQL registry. |
| bolt/functions/sparksql/registration/Register.cpp | Hooks bitmap function registration into the overall Spark SQL registration flow. |
| bolt/functions/sparksql/registration/CMakeLists.txt | Adds RegisterBitmap.cpp to the Spark functions registration library build. |
| bolt/functions/sparksql/Bitmap.h | Implements BitmapBitPositionFunction and bitmap bucket-size constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+17
to
+19
| #include <limits> | ||
| #include <optional> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Bolt does not currently register Spark 3.5's
bitmap_bit_position, so queries using the bitmap aggregation pipeline cannot execute this scalar step natively.Issue Number: close #758
Type of Change
Description
bitmap_bit_position(BIGINT) -> BIGINTscalar functionINT64_MINthrough unsigned magnitude arithmetic, avoiding signed-overflow undefined behavior while matching Java/Spark resultsPerformance Impact
Release Note
Validation
clang-format 14.0.6 --dry-run --Werroron all changed C++ filesgit diff --checkINT64_MINandINT64_MAXChecklist (For Author)
Breaking Changes