datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

fix: spark modulus need to have custom nullability

Open JSOD11 opened this issue 1 month ago • 1 comments

Which issue does this PR close?

  • Closes #19165.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

JSOD11 avatar Dec 10 '25 20:12 JSOD11

@JSOD11 Please add unit test for all your changes.

kumarUjjawal avatar Dec 11 '25 04:12 kumarUjjawal

Can we do something like this

fn return_field_for_binary_op(
    name: &str,
    args: ReturnFieldArgs,
) -> Result<FieldRef> {
    let any_nullable = args.arg_fields.iter().any(|f| f.is_nullable());
    let data_type = args.arg_fields[0].data_type().clone();
    Ok(Arc::new(Field::new(name, data_type, any_nullable)))
}

And use in both the return_field_from_args functions to improve maintainability.

kumarUjjawal avatar Dec 13 '25 07:12 kumarUjjawal