Weijun-H commented on issue #17993: URL: https://github.com/apache/datafusion/issues/17993#issuecomment-3394076870
After investigation, I agree with @Omega359 that wiring `ConfigOptions` into `return_field_from_args` would be a massive undertaking with questionable ROI. However, I'd like us to reconsider whether this feature justifies the architectural complexity. **The Core Issue** The problem manifests in subqueries: ```sql -- Works fine SELECT now() = '2000-01-01'::date; -- Fails with schema mismatch SELECT count(1) FROM (SELECT now() as n) a WHERE n = '2000-01-01'::date; ``` **Root Cause** Subquery schemas are materialized at planning time via `return_field_from_args()`, which lacks access to `ConfigOptions`. However, the actual return type comes from `simplify()`, which *does* have config access. This creates a schema/data type mismatch that Arrow rightfully rejects. **The Key Question** I don't see many other built-in functions requiring config-dependent return types. If `now()` is largely an isolated case, a major architectural refactor may not be warranted. **Proposal** Before proceeding with the refactor, I suggest we: 1. Identify if other functions have similar config-dependent behavior 2. Evaluate the user impact - how frequently is this pattern encountered? 3. Consider targeted alternatives (special casing, schema deferral, etc.) Waiting for others' feedback on whether this pattern is common enough to justify the architectural investment. -- 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]
