You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "adriangb (via GitHub)" <gi...@apache.org> on 2026/10/15 00:43:55 UTC

[I] Planning fails with "Conflicting types" when one placeholder is inferred with two types [datafusion]

adriangb opened a new issue, #26343:
URL: https://github.com/apache/datafusion/issues/26343

   Since #25364, `TypeCoercion` calls `get_parameter_fields()` on every plan and fails when one placeholder has two inferred types. A query that uses the same placeholder where the SQL planner infers different types no longer plans, even before any value is bound.
   
   ```rust
   let ctx = SessionContext::new();
   ctx.sql("CREATE TABLE t AS SELECT arrow_cast(now(), 'Timestamp(Microsecond, Some(\"UTC\"))') AS ts").await?;
   let state = ctx.state();
   let plan = state
       .create_logical_plan("SELECT ts FROM t WHERE ts >= $1 AND $1 = date_bin(INTERVAL '1 minute', $1)")
       .await?;
   state.optimize(&plan)?;
   ```
   
   Expected: the plan optimizes, as it did before #25364.
   
   Actual:
   
   ```
   type_coercion: Error during planning: Expected parameter of type Timestamp(µs, "UTC"), got Timestamp(ns): Conflicting types for id $1
   ```
   
   `ts >= $1` infers `Timestamp(µs, "UTC")` and `$1 = date_bin(..., $1)` infers `Timestamp(ns)`. The conflict check makes sense for `PREPARE`, but it now also rejects plain plans that bind values later with `replace_params_with_values`.
   
   cc @1fanwang
   


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Planning fails with "Conflicting types" when one placeholder is inferred with two types [datafusion]

Posted by "1fanwang (via GitHub)" <gi...@apache.org>.
1fanwang commented on issue #26343:
URL: https://github.com/apache/datafusion/issues/26343#issuecomment-6194605105

   take


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Planning fails with "Conflicting types" when one placeholder is inferred with two types [datafusion]

Posted by "1fanwang (via GitHub)" <gi...@apache.org>.
1fanwang commented on issue #26343:
URL: https://github.com/apache/datafusion/issues/26343#issuecomment-6204043810

   The prepared patch is at https://github.com/1fanwang/datafusion/commit/a6d4c3d9b935bfc0f28f101ad3ba503d206d3db9. The repository's open-PR cap currently blocks my submission. @adriangb, could a maintainer review the commit and take it forward?
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Planning fails with "Conflicting types" when one placeholder is inferred with two types [datafusion]

Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb commented on issue #26343:
URL: https://github.com/apache/datafusion/issues/26343#issuecomment-6251728158

   Could you open it as a draft PR? Also I think we've merged some of your open PRs so maybe you're under the limit now. Thanks!


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org