Skip to content

Inconsistent/ unexpected error when using strptime() in combination with format-list option #12287

@frankzandhuis

Description

@frankzandhuis

What happens?

In JDBC via Dbeaver, when trying to convert a string 07:00 to time, via the function STRPTIME an error is thrown when using the format-list method, whereas using the format method does work as expected.

When testing this in DuckDB Wasm, I don't get this error (v0.10.2 - @duckdb/duckdb-wasm@1.28.1-dev195.0)

Perhaps my use of this function is not as intended, but at least there is inconsistency between format-list and format for this function and use case.

To Reproduce

A minimum working example to demonstrate this issue:

SELECT ('07:00').STRPTIME('%H:%M')::time;
SELECT ('07:00').STRPTIME(['%H:%M'])::time;

The first works, the second throws an error:

Reason:
SQL Error: Conversion Error: Unimplemented type for cast (TIMESTAMP WITH TIME ZONE -> TIME)
LINE 1: SELECT ('07:00').STRPTIME(['%H:%M'])::time

OS:

Windows, x64

DuckDB Version:

0.10.3

DuckDB Client:

JDBC, via Dbeaver

Full Name:

Frank Zandhuis

Affiliation:

1 Giant Leap Solutions

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