Skip to content

NULL::<Data type> can't be encode to substrait #15855

@discord9

Description

@discord9

Describe the bug

as title, NULL::<Data type> can't be encode to substrait, WIP fix in #15854

To Reproduce

try run this unit test:

#[tokio::test]
    async fn fold_cast_null(){
        let state = SessionStateBuilder::default().build();
        let empty_schema = DFSchemaRef::new(DFSchema::empty());
        let field = Field::new("out", DataType::Int32, false);

        let expr = Expr::Literal(ScalarValue::Null).cast_to(&DataType::Int32, &empty_schema).unwrap();
    
        let typed_null =to_substrait_extended_expr(&[(&expr, &field)], &empty_schema, &state).unwrap();
}

and it will fail with "Null cast is invalid" or something

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions