Skip to content

Make migration to Signature::nullary in 44.0.0 easier / less confusing #13763

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

While working to reproduce the issue from @kylebarron here:

He had this signature for a UDF that has no arguments

impl UnionExample {
    pub fn new() -> Self {
        Self {
            signature: Signature::any(0, Volatility::Immutable),
        }
    }
}

This compiled without error / incident

However, when I ran that on latest main I got a very strange (to me) error:

called Result::unwrap() on an Err value: Plan("Error during planning: example_union does not support zero arguments. No function matches the given name and argument types 'example_union()'. You might need to add explicit type casts.\n\tCandidate functions:\n\texample_union()")

To fix it I found I had to:

-            signature: Signature::any(0, Volatility::Immutable),
+            signature: Signature::nullary(Volatility::Volatile),

I think this will make upgrading to 44 a pain

Describe the solution you'd like

I would like DataFusion to either:

  1. Support the old style signature for zero args
  2. Generate a clear error that tells me what I have to fix in my code (aka change to nullary

Describe alternatives you've considered

No response

Additional context

Nullary appears to have been added in this PR by @jayzhan211

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestregressionSomething that used to work no longer does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions