Blizzara commented on issue #11201:
URL: https://github.com/apache/datafusion/issues/11201#issuecomment-2922682982

   Just fwiw, we already use Comet's Cast in our use of DF, through a rewrite 
rule:
   ```
   impl FunctionRewrite for OurCastRewrite {
       fn name(&self) -> &str {
           "use_comet_cast"
       }
   
       fn rewrite(
           &self,
           expr: Expr,
           _schema: &DFSchema,
           _config: &ConfigOptions,
       ) -> datafusion::common::Result<Transformed<Expr>> {
           match expr {
               Expr::Cast(cast) => {
                   let new_expr = 
ScalarUDF::from(OurCometSparkCastUdf::new(&cast.data_type))
                       .call(vec![*cast.expr]);
                   Ok(Transformed::yes(new_expr))
               }
               _ => Ok(Transformed::no(expr)),
           }
       }
   }
   ```
   This has seemed to work so far, but likely isn't ideal solution. We also 
have to run the analyser twice, since the first run may create more casts that 
then still need to be rewritten..


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