fix(pgwire): support UUID bind variables in JIT filters#6413
fix(pgwire): support UUID bind variables in JIT filters#6413bluestreak01 merged 5 commits intomasterfrom
Conversation
This change adds support for UUID binding variables within JIT-compiled filters. Before this fix, PGWire queries eligible for JIT compilation that used a UUID parameter would fail with: 'ERROR: unsupported bind variable type: UUID' Workaround before this fix: If you encounter this error on an unpatched version, use explicit casting to bypass JIT compilation: Instead of: SELECT * FROM table WHERE uuid = $1; Use: SELECT * FROM table WHERE uuid = $1::uuid;
WalkthroughAdds UUID (128-bit) type binding support to the AVM/JIT bind-variable writing path in AsyncJitFilteredRecordCursorFactory by retrieving UUID values via getLong128Lo/Hi and writing them with putLong128(lo, hi). Includes test coverage verifying UUID binding functionality across bind variables, compiled filters, and PostgreSQL wire protocol contexts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10-15 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai pls review |
|
@jerrinot: I'll review the changes now. I notice that the PR title needs to be updated to match the required format: or depending on which component is most appropriate for this change. I'll proceed with the review of the code changes. ✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
core/src/test/java/io/questdb/test/griffin/CompiledFilterTest.java (1)
553-577: LGTM! UUID binding test is well-structured.The test correctly exercises UUID bind variable functionality in the compiled filter path, following the established pattern from
testAllBindVariableTypes(). It properly validates both normal execution and JIT compilation.For future enhancement, consider adding test coverage for:
- Null UUID values
- Named bind variables (e.g.,
:uuid)- Multiple UUID comparisons in a single query
core/src/test/java/io/questdb/test/griffin/engine/functions/bind/BindVariablesTest.java (1)
894-910: LGTM! UUID binding and insertion test is correct.The test properly validates UUID bind variable functionality for the insertion path, following the pattern established by
testIPv4()above it. The use ofgetFunction(0)beforesetUuid()is consistent with existing bind variable tests.For comprehensive coverage, consider adding tests for:
- Null UUID handling
- Named bind variables (e.g.,
:uuid)- Bind variable reuse with different UUID values
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
core/src/main/java/io/questdb/griffin/engine/table/AsyncJitFilteredRecordCursorFactory.java(1 hunks)core/src/test/java/io/questdb/test/cutlass/pgwire/PGJobContextTest.java(1 hunks)core/src/test/java/io/questdb/test/griffin/CompiledFilterTest.java(2 hunks)core/src/test/java/io/questdb/test/griffin/engine/functions/bind/BindVariablesTest.java(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (36)
- GitHub Check: build
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-other)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-pgwire)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-cairo-sub)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-cairo-root)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-fuzz2)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-fuzz1)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-griffin-sub)
- GitHub Check: New pull request (SelfHosted Other tests on linux-x64-zfs)
- GitHub Check: New pull request (Rust Test and Lint on linux-jdk17)
- GitHub Check: New pull request (SelfHosted Other tests on linux-x86-graal)
- GitHub Check: New pull request (SelfHosted Running tests with cover on linux-griffin-root)
- GitHub Check: New pull request (Hosted Running tests on windows-other-2)
- GitHub Check: New pull request (Hosted Running tests on windows-other-1)
- GitHub Check: New pull request (Hosted Running tests on windows-pgwire)
- GitHub Check: New pull request (Hosted Running tests on windows-cairo-2)
- GitHub Check: New pull request (Hosted Running tests on windows-cairo-1)
- GitHub Check: New pull request (Hosted Running tests on windows-fuzz2)
- GitHub Check: New pull request (Hosted Running tests on windows-fuzz1)
- GitHub Check: New pull request (Hosted Running tests on windows-griffin-sub)
- GitHub Check: New pull request (Hosted Running tests on windows-griffin-base)
- GitHub Check: New pull request (Hosted Running tests on mac-other)
- GitHub Check: New pull request (Hosted Running tests on mac-pgwire)
- GitHub Check: New pull request (Hosted Running tests on mac-cairo-fuzz)
- GitHub Check: New pull request (Hosted Running tests on mac-cairo)
- GitHub Check: New pull request (SelfHosted Cairo tests on linux-x64-zfs)
- GitHub Check: New pull request (SelfHosted Cairo tests on linux-arm64)
- GitHub Check: New pull request (Hosted Running tests on mac-griffin)
- GitHub Check: New pull request (SelfHosted Other tests on linux-arm64)
- GitHub Check: New pull request (SelfHosted Griffin tests on linux-x86-graal)
- GitHub Check: New pull request (SelfHosted Griffin tests on linux-x64-zfs)
- GitHub Check: New pull request (SelfHosted Griffin tests on linux-arm64)
- GitHub Check: New pull request (SelfHosted Cairo tests on linux-x86-graal)
- GitHub Check: New pull request (Check Changes Check changes)
- GitHub Check: build
- GitHub Check: build
🔇 Additional comments (3)
core/src/main/java/io/questdb/griffin/engine/table/AsyncJitFilteredRecordCursorFactory.java (1)
418-422: LGTM! UUID binding support correctly implemented.The implementation correctly handles UUID as a 128-bit value by retrieving the low and high parts and writing them to bind variable memory. This follows the established pattern for other types in the switch statement and completes the bind variable type support for UUID.
core/src/test/java/io/questdb/test/griffin/CompiledFilterTest.java (1)
38-38: LGTM! Uuid import added for new test.The import is correctly placed alphabetically and supports the new UUID binding test.
core/src/test/java/io/questdb/test/griffin/engine/functions/bind/BindVariablesTest.java (1)
62-62: LGTM! Uuid import added for new test.The import is correctly placed alphabetically and supports the new UUID binding test.
[PR Coverage check]😍 pass : 4 / 4 (100.00%) file detail
|
This change adds support for UUID binding variables within JIT-compiled filters.
Before this fix, PGWire queries eligible for JIT compilation that used a UUID parameter
would fail with:
ERROR: unsupported bind variable type: UUIDWorkaround before this fix:
If you encounter this error on an unpatched version, use explicit casting
to disable JIT:
Instead of:
SELECT * FROM table WHERE uuid = $1;Use:
SELECT * FROM table WHERE uuid = $1::uuid;Fixes #6408