Skip to content

[FEATURE] PPL-Calcite Function Parameter Validation #3608

@yuancu

Description

@yuancu

Is your feature request related to a problem?
#3229 implements PPL functions with the Calcite engine. However, the parameter types and lengths are not being checked for the time being. It will only throw error at execution time.

Currently, if the parameter type / length is incorrect, it will throw an error like:

Exception happened during execution
...
    Caused by java.lang.RuntimeException: java.sql.SQLException: Error while preparing plan..
    ...
        Caused by: Suppressed: java.lang.RuntimeException: while resolving method methodName(paramType1, paramType2, ...)
        ...
             Caused by: java.lang.NoSuchMethodException: methodName(paramType1, paramType2, ...)
             ...

Users will see the first error message with an 500 internal error tag in their request response. An error message with the wrong and proper parameter types will be more informative to users.

The validation mechanism from Calcite is not used -- the phase it takes effect is skipped.

What solution would you like?
Implement a function validation mechanism.

What alternatives have you considered?

Do you have any additional context?

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLPiped processing languagecalcitecalcite migration releatedenhancementNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions