Probablism opened a new pull request, #23260:
URL: https://github.com/apache/datafusion/pull/23260

   # PR Title
   
   fix: infer LIMIT and OFFSET placeholder parameter types
   
   # PR Body
   
   ## Which issue does this PR close?
   
   - Closes #15978.
   
   ## Rationale for this change
   
   Bare placeholders used as `LIMIT` or `OFFSET` row-count expressions 
currently remain untyped in `LogicalPlan::get_parameter_types()`. DataFusion 
already coerces LIMIT/OFFSET row counts to `Int64` during analysis, so the 
metadata APIs should report the same type for bare row-count placeholders.
   
   ## What changes are included in this PR?
   
   - Infer `Int64` parameter fields for bare unresolved placeholders used 
directly as `LIMIT` or `OFFSET` expressions.
   - Reuse existing expression placeholder inference before applying the 
LIMIT/OFFSET fallback, so nested expressions keep their local inference 
behavior.
   - Preserve existing placeholder conflict detection.
   - Add raw logical-plan and SQL/PREPARE regression tests for LIMIT/OFFSET 
parameter inference.
   
   ## Are these changes tested?
   
   Yes:
   
   - `cargo fmt --all -- --check`
   - `cargo test -p datafusion-expr test_limit_`
   - `cargo test -p datafusion-sql --test sql_integration 
test_infer_types_from_limit`
   - `cargo test -p datafusion-sql --test sql_integration 
test_prepare_statement_infer_types_from_limit`
   - `cargo test -p datafusion`
   - `cargo test -p datafusion-cli`
   - `cargo test --profile=ci --test sqllogictests`
   - `./dev/rust_lint.sh`
   
   ## Are there any user-facing changes?
   
   Yes. `LogicalPlan::get_parameter_types()` and 
`LogicalPlan::get_parameter_fields()` now report `Int64` for bare placeholders 
used directly in `LIMIT` and `OFFSET`. There are no breaking API changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to