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

   ## Which issue does this PR close?
   
   Closes #12105 
   
   ## Rationale for this change
   
   We construct our own logical plans for SQL-derivative languages (e.g. 
InfluxQL). The construction of logic plans using UNION requires that upon 
construction of the union plan node, we type-coercion the expressions prior to 
building the rest of the plan. If we don't perform this expression rewrite, 
then our consuming LIMIT, GROUP BY, ORDER BY, and aggregates will not be built 
properly.
   
   We do not think our use case is unique, and therefore we are (a) exposing 
the APIs need to perform this coercion and (b) providing docs.
   
   ## What changes are included in this PR?
   
   * Expose the expression rewriter. 
      * There is precedence for other rewriters being exposed, such as 
[PullUpCorrelatedExpr](https://docs.rs/datafusion-optimizer/41.0.0/datafusion_optimizer/decorrelate/struct.PullUpCorrelatedExpr.html)
 and 
[GuaranteeRewriter](https://docs.rs/datafusion-optimizer/41.0.0/datafusion_optimizer/simplify_expressions/struct.GuaranteeRewriter.html).
   * expose helper method `coerce_union_schema`
   * provide docs delineating the different type-coercion interfaces: 
`TypeCoercion` vs `TypeCoercionRewriter` vs helper `coerce_union_schema`.
   * update the `union()` API, which does the logical plan construction of 
how/when/why to use the type coercion.
   
   
   ## Are these changes tested?
   
   No code changes.
   
   ## Are there any user-facing changes?
   
   No. Only more exposed interfaces to use.


-- 
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-unsubscr...@datafusion.apache.org

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


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

Reply via email to