doki23 commented on code in PR #2177:
URL: https://github.com/apache/arrow-datafusion/pull/2177#discussion_r861450604
##########
datafusion/expr/src/function.rs:
##########
@@ -39,6 +40,10 @@ use std::sync::Arc;
pub type ScalarFunctionImplementation =
Arc<dyn Fn(&[ColumnarValue]) -> Result<ColumnarValue> + Send + Sync>;
+/// Table function. Second tuple
+pub type TableFunctionImplementation =
+ Arc<dyn Fn(&[ColumnarValue], usize) -> Result<(ArrayRef, Vec<usize>)> +
Send + Sync>;
Review Comment:
I guess that @gandronchik wants to chain each result(ArrayRef) of
`TableFunctionImplementation` into a multi-column result (see the code in
`TableFunStream::batch`), which may mean the table udf consists of multi exprs.
The reason should be trait `PhysicalExpr` only provides `fn evaluate(&self,
batch: &RecordBatch) -> Result<ColumnarValue>`. But I agree that `Arc<dyn
Fn(&[ColumnarValue]) -> Result<Vec<ColumnarValue>> + Send + Sync>` is more
proper. So I believe that the approach may be directly invoke the table udf in
the `TableFunStream` without implementing trait `PhysicalExpr` for it.
--
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]