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

   ### Is your feature request related to a problem or challenge?
   
   Our database uses `sqlparser` to parse a custom SQL statement, and we skip 
the logical plan to directly construct an execution plan with DataFusion. This 
SQL statement includes a WHERE clause, so we need to construct a FilterExec. 
During the process of building FilterExec, we found that the 
`create_physical_expr` method from the `datafusion-physical-expr` module 
doesn’t perform type coercion, but instead assumes all expressions have already 
undergone type coercion.
   
   To implement type coercion, we reviewed the DataFusion source code and found 
that from higher-level APIs to lower-level ones, there are several approaches 
that support type coercion for expressions:
   
   Using `SessionContext::create_physical_expr`
   Using `ExprSimplifier::coerce`
   Using `TreeNodeRewriter::rewrite based on TypeCoercionRewriter`
   Using `TreeNode::rewrite`
   In our case, we only want to perform type coercion on expressions, so 
`TypeCoercionRewriter` seems to be the best fit. However, we’re unable to 
create a `TypeCoercionRewriter` instance because its `new` method isn’t public.
   
   We would like DataFusion to expose `TypeCoercionRewriter::new`. If there is 
another, simpler method to achieve this, please let us know. Thank you.
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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