Skip to content

date_diff function call errors with timestamptz and date parameters #18047

@kirankpandi

Description

@kirankpandi

What happens?

date_diff function with timestamptz and date parameters fails with the error below:

No function matches the given name and argument types 'date_diff(STRING_LITERAL, TIMESTAMP WITH TIME ZONE, DATE)'. You might need to add explicit type casts.
	Candidate functions:
	date_diff(VARCHAR, DATE, DATE) -> BIGINT
	date_diff(VARCHAR, TIME, TIME) -> BIGINT
	date_diff(VARCHAR, TIMESTAMP, TIMESTAMP) -> BIGINT
	date_diff(VARCHAR, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH TIME ZONE) -> BIGINT

It was working fine in 1.2.2 and is fialing only in versions >= 1.3.0.

To Reproduce

Execute the query below in DuckDB CLI:

select date_diff('day', '2022-01-04 19:00:00'::timestamptz, '2024-03-01'::date) as c1;

OS:

MacOS aarch64

DuckDB Version:

1.3.0

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Kiran Pandi

Affiliation:

ThoughtSpot Inc

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions