lewiszlw commented on issue #7871:
URL: 
https://github.com/apache/arrow-datafusion/issues/7871#issuecomment-1832284266

   > The 
[TableProvider](https://docs.rs/datafusion/latest/datafusion/datasource/provider/trait.TableProvider.html#)
 trait does not have any way to communicate this information directly as it is 
not used until physcal planning, but the ExecutionPlan returned by 
TableProvider::scan does allow setting this via 
[ExecutionPlan::output_ordering](https://docs.rs/datafusion/latest/datafusion/physical_plan/trait.ExecutionPlan.html#tymethod.output_ordering)
   
   @alamb  `ExecutionPlan::output_ordering` seems can not support both asc and 
desc for one column, because TableProvider doesn't pass sort option to scan 
execution plan.
   
   ```
   #[async_trait]
   pub trait TableProvider: Sync + Send {
       async fn scan(
           &self,
           state: &SessionState,
           projection: Option<&Vec<usize>>,
           filters: &[Expr],
           limit: Option<usize>,
           sort: &[Expr],
       ) -> Result<Arc<dyn ExecutionPlan>>;
   }
   ```
   We could pass sort exprs to scan, then users can construct ExecutionPlan 
based on sort exprs.


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