kosiew commented on code in PR #25364:
URL: https://github.com/apache/datafusion/pull/25364#discussion_r4184935979


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -1836,14 +1836,30 @@ impl LogicalPlan {
             .collect())
     }
 
-    /// Walk the logical plan, find any `Placeholder` tokens, and return a map 
of their IDs and FieldRefs
+    /// Walk the logical plan, find any `Placeholder` tokens, and return a map 
of their IDs and FieldRefs.
+    /// Bare `LIMIT`/`OFFSET` parameters default to `Int64` if no occurrence 
provides a type.
     pub fn get_parameter_fields(
         &self,
     ) -> Result<HashMap<String, Option<FieldRef>>, DataFusionError> {
         let mut param_types: HashMap<String, Option<FieldRef>> = 
HashMap::new();
+        let mut row_count_parameters: HashSet<String> = HashSet::new();
 
         self.apply_with_subqueries(|plan| {
             plan.apply_expressions(|expr| {
+                if matches!(plan, LogicalPlan::Limit(_)) {
+                    // Keep the analyzer's implicit Int64 cast transparent to 
row-count inference.
+                    let operand = match expr {
+                        Expr::Cast(Cast { expr, field })

Review Comment:
   This unwrap treats any Int64 cast as the analyzer's implicit LIMIT/OFFSET 
coercion, so an explicit `CAST($1 AS BIGINT)` incorrectly makes `$1` infer as 
Int64. Please distinguish the implicit coercion from a user-written cast, and 
add a BIGINT regression next to 
`test_limit_offset_parameters_leave_cast_inputs_unresolved`.



-- 
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