alamb commented on issue #4850:
URL: 
https://github.com/apache/arrow-datafusion/issues/4850#issuecomment-1720052986

   > Therefore, we can make a new trait that returns a TableProvider and 
execute the table function in create_relation and using TableScan to build a 
LogicPlan
   
   I think one big difference is that a table function can take some number of 
parameters
   
   ```
   SELECT * FROM read_parquet('test.parquet');
   ```
   
   The table function is `read_parquet(..)` which gets arguments of a string 
`test.parquet`. 
   
   The SQL parser will give the argument as an `Expr`. 
   
https://docs.rs/sqlparser/latest/sqlparser/ast/enum.TableFactor.html#variant.TableFunction
   
   So perhaps we could make the `TableFuncton` trait like:
   
   ```rust
   #[async_trait]
   pub trait TableFunction: Sync + Send {
       async fn execute(
           &self,
           arg: Expr,
           state: &SessionState,
       ) -> Result<Arc<dyn TableProvider>>;
   }
   ```
   
   To take that arbitrary argument in


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