Skip to content

Incorrect null literal handling for to_local_time() function (SQLancer) #17472

@2010YOUY01

Description

@2010YOUY01

Describe the bug

datafusion-cli is compiled from the latest main commit d19bf52

> select to_local_time(null);
Error during planning: Execution error: Function 'to_local_time' user-defined coercion failed with "Error during planning: The to_local_time function can only accept Timestamp as the arg got Null" No function matches the given name and argument types 'to_local_time(Null)'. You might need to add explicit type casts.
        Candidate functions:
        to_local_time(UserDefined)

null literal can be interpreted as a missing value of Timestamp type, I think it would be more reasonable to return NULL instead of planning error.

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLancer #11030

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions