thinkharderdev commented on PR #2177:
URL: 
https://github.com/apache/arrow-datafusion/pull/2177#issuecomment-1100368801

   > what about `Result<Vec<ColumnarValue>>`. I already almost implemented it 
this way:)
   > 
   > > > It seems like a table function should produce RecordBatchs and 
effectively compile down to an ExecutionPlan.
   > > 
   > > 
   > > I agree it should definitely produce `RecordBatch`
   
   That's essentially a `RecordBatch` :) 
   
   You could have 
   ```rust
   pub type TableFunctionImplementation =
       Arc<dyn Fn(&[ColumnarValue]) -> Result<Vec<ColumnarValue>> + Send + 
Sync>;
   
   // This is a terrible name but this would be analogous to 
ReturnTypeFunction/StateTypeFunction
   pub type TableSchemaFunction = 
       Arc<dyn Fn(&[DataType]) -> Result<SchemaRef> + Send + Sync>; 
   ```


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