-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Same as title
To Reproduce
use datafusion::prelude::*;
use datafusion_expr::BuiltinScalarFunction;
#[tokio::main]
async fn main() -> 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(())
}Expected behavior
No error
Additional context
Returns the following error:
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"))
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working