piyush15102003 commented on issue #27535: URL: https://github.com/apache/datafusion/issues/27535#issuecomment-7137644206
Thanks! Reproduced on current `main` with a sqllogictest (`1 1` instead of `1 2`, same for `range`). Root cause: `TableScan`'s `PartialEq`/`Hash` (`datafusion/expr/src/logical_plan/plan.rs`) ignore `source`, and table functions are planned with only the function name as `table_name` (`datafusion/sql/src/relation/mod.rs`), so `generate_series(1, 1)` and `generate_series(2, 2)` compare equal and the physical planner's scalar-subquery dedup map merges them. Options I see: 1. Include `Arc::ptr_eq(&source)` in `TableScan` eq/hash. Simplest, but it may affect proto/substrait roundtrip equality and dedup of scans whose provider is resolved twice. 2. Put the arguments in the table function's `table_name`. Small, but it changes `EXPLAIN` output and column qualifiers. 3. Let the source report an identity that eq/hash use. Correct without visible changes, but it touches a public trait. Which direction would you prefer? -- 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]
