dovijoel commented on issue #2869:
URL: 
https://github.com/apache/arrow-datafusion/issues/2869#issuecomment-1196815138

   I am still having this issue while using the master branch with using the 
API. Am I doing something incorrectly?
   ```rust
   // create expression for close price with a lead window function
   let close_expr = Expr::WindowFunction {
           fun: 
WindowFunction::BuiltInWindowFunction(BuiltInWindowFunction::Lead),
           args: vec![col("PX_LAST"), lit(10)],
           partition_by: vec![col("InstrumentID")],
           order_by: vec![Sort {
               expr: Box::new(col("dates")),
               asc: ascending,
               nulls_first: false
           }],
           window_frame: None
       }
   // calculate the return
   let return_expr = (close_expr / col("PX_LAST")) - 1.0;
   let returnsDf = df.select(vec![
           col("dates"),
           col("InstrumentID"),
           col("PX_LAST").alias("open_price"),
           close_expr.alias("close_price"),
           return_expr.alias("return")
       ])?;
   
   dailyReturnsDf.show_limit(100).await?;
   ```
   
   This results in: 
   `Error: NotImplemented("Physical plan does not support logical expression 
LEAD(#raw_data.PX_LAST, Int64(10)) PARTITION BY [#raw_data.InstrumentID] ORDER 
BY [#raw_data.dates ASC NULLS LAST]")`
   


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

Reply via email to