use datafusion::prelude::*;use datafusion_expr::BuiltinScalarFunction;
#[tokio::main]asyncfnmain() -> datafusion::error::Result<()>{let ctx = SessionContext::new();
ctx.register_csv("example","tests/data/example.csv",CsvReadOptions::new()).await?;
let df = ctx.table("example").await?;
let f = Expr::ScalarFunction(datafusion_expr::expr::ScalarFunction{fun:BuiltinScalarFunction::Struct,args:vec![col("a"), col("b")],});
let df2 = df.select(vec![f])?;
df2.show().await?;Ok(())}Error: ArrowError(InvalidArgumentError("column types must match schema types, expected Struct([]) but found Struct([Field { name: \"c0\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"c1\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) at column index 0"))
Describe the bug
Same as title
To Reproduce
Expected behavior
No error
Additional context
Returns the following error: