Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The time conversion function cannot convert string type to time type #2169

Open
IvanGao01 opened this issue Jun 7, 2024 · 1 comment
Open
Labels
type/bug Something isn't working
Milestone

Comments

@IvanGao01
Copy link
Member

Describe the bug

The following time functions do not operate on time strings with the format_n parameter, as expected, and the following functions have this problem:

to_timestamp
to_timestamp_millis
to_timestamp_micros
to_timestamp_seconds

To Reproduce

public ❯ select to_timestamp('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
422 Unprocessable Entity, details: {"error_code":"010001","error_message":"Datafusion: Error during planning: No function matches the given name and argument types 'to_timestamp(Utf8, Utf8, Utf8, Utf8)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tto_timestamp(Int64/Timestamp(Nanosecond, None)/Timestamp(Microsecond, None)/Timestamp(Millisecond, None)/Timestamp(Second, None)/Utf8)"}

Expected behavior

> select to_timestamp('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
+--------------------------------------------------------------------------------------------------------+
| to_timestamp(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
+--------------------------------------------------------------------------------------------------------+
| 2023-05-17T03:59:00.123456789                                                                          |
+--------------------------------------------------------------------------------------------------------+

Additional context

cnosdb 2.4.1, revision fc729e3

@IvanGao01 IvanGao01 added the type/bug Something isn't working label Jun 7, 2024
@roseboy-liu roseboy-liu assigned Kree0 and unassigned roseboy-liu Jun 7, 2024
@Kree0
Copy link
Contributor

Kree0 commented Jun 17, 2024

This function is implemented by datafusion. The feature you mentioned is only supported by the new version of datafusion, so you need to wait for cnosdb to update the datafusion version.

@roseboy-liu roseboy-liu modified the milestones: V2.4.2, Long Term Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants