Conversation
Preserve known parameter fields before applying row-count defaults and keep incomplete PREPARE signatures deferred. Fixes apache#15978 Signed-off-by: 1fanwang <1fannnw@gmail.com>
…eter-types-2e62cbd8 Signed-off-by: 1fanwang <1fannnw@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25364 +/- ##
==========================================
- Coverage 81.94% 81.94% -0.01%
==========================================
Files 1135 1135
Lines 428278 428292 +14
Branches 428278 428292 +14
==========================================
+ Hits 350945 350951 +6
- Misses 56378 56384 +6
- Partials 20955 20957 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which issue does this PR close?
LIMITclause #15978.Rationale for this change
Prepared-statement clients get no type for LIMIT/OFFSET arguments even when the query executes correctly. A later untyped occurrence can also erase an already inferred parameter type.
Prior work: #15980 and #23260.
What changes are included in this PR?
Default bare row-count parameters to Int64 only after collecting other type information. Preserve known fields and keep incomplete PREPARE signatures deferred rather than dropping unknown positions.
What is the testing strategy for this PR?
The tests plan, bind and execute real SQL, including mixed-type PREPARE statements. The same command ran on the base with the regression tests added, then on the fix, using Linux and Rust 1.98.1:
CARGO_BUILD_JOBS=2 cargo test --locked --profile ci -p datafusion \ --test core_integration test_limit_offset_parameters \ -- --nocapture --test-threads=1Before:
After:
Additional raw PREPARE output
Before:
After:
Are there any user-facing changes?
Yes. Parameter metadata supplies integer types for otherwise-untyped LIMIT/OFFSET arguments while retaining known types and field metadata.