Ted-Jiang commented on issue #2330:
URL:
https://github.com/apache/arrow-datafusion/issues/2330#issuecomment-1109792696
@andygrove Another question, if add TableFunction like ScalarFunction
```rust
/// Represents the call of a built-in scalar function with a set of
arguments.
ScalarFunction {
/// The function
fun: built_in_function::BuiltinScalarFunction,
/// List of expressions to feed to the functions as arguments
args: Vec<Expr>,
},
TableFunction {
/// The function
fun: built_in_function::BuiltinTableFunction,
/// List of expressions to feed to the functions as arguments
args: Vec<Expr>,
},
```
if we treat it as a `Expr` , we need change it to `PhysicalExpr` but
``` rust
/// Evaluate an expression against a RecordBatch
fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue>;
```
```rust
pub enum ColumnarValue {
/// Array of values
Array(ArrayRef),
/// A single value
Scalar(ScalarValue),
}
```
cause of it return ColumnarValue, we can not return result as a table, am i
right?
Should i implement a `TablePhysicalExpr`
using
```rust
fn evaluate(&self, batch: &RecordBatch) -> Result<Vec<ColumnarValue>>;
```
--
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]