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

Issue with date_parse in Metabase Starburst Driver 6.0.1 #147

Open
digarcia78 opened this issue Feb 25, 2025 · 4 comments
Open

Issue with date_parse in Metabase Starburst Driver 6.0.1 #147

digarcia78 opened this issue Feb 25, 2025 · 4 comments

Comments

@digarcia78
Copy link

I recently updated from the deprecated Presto driver to the latest Metabase Starburst Driver version 6.0.1, running Metabase 0.52.12, and encountered an issue when trying to execute the following query:

SELECT date_parse('07-Sep-2021 04:57 PM', '%d-%b-%Y %l:%i %p');

This query worked perfectly fine with the Presto driver, but after upgrading to the Metabase Starburst Driver (v6.0.1), I receive the following error:

Query failed (#20250225_133405_08261_8bqpr): Invalid format: "07-Sep-2021 04:57 PM" is malformed at "Sep-2021 04:57 PM"

It seems like the issue is related to the "PM" and the "Sep" abbreviation for the month, which are not recognized properly in the Metabase Starburst Driver, whereas they were parsed correctly in the Presto driver.

Steps to reproduce:

- Install Metabase 0.52.12 with Metabase Starburst Driver version 6.0.1.
- Execute the query:
     SELECT date_parse('07-Sep-2021 04:57 PM', '%d-%b-%Y %l:%i %p');

Question:
Since I’m aware there hasn’t been a new driver released, is there any alternative solution to resolve this issue, or is there a workaround that can address the parsing issue with the "Sep" month abbreviation and "PM"?

@lpoulain
Copy link
Collaborator

I tried running this query using the Metabase Starburst Driver version 6.1.0 and could not reproduce the issue.

@digarcia78
Copy link
Author

I'm using Trino v448 (open source) and encountered this issue. Could the problem be related to the Trino version? Is there any other solution that doesn't require updating Trino?

@lpoulain
Copy link
Collaborator

What actual query is executed on Trino? Is it this exact same query or a different one?

@digarcia78
Copy link
Author

Yes, Trino executes the exact same query. The error thrown is of type USER_ERROR with the code INVALID_FUNCTION_ARGUMENT. The stack trace indicates an issue with parsing the date format at "Sep-2021 04:57 PM":

io.trino.spi.TrinoException: Invalid format: "07-Sep-2021 04:57 PM" is malformed at "Sep-2021 04:57 PM"
at io.trino.operator.scalar.DateTimeFunctions.dateParse(DateTimeFunctions.java:402)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
at io.trino.sql.InterpretedFunctionInvoker.invoke(InterpretedFunctionInvoker.java:101)
at io.trino.sql.planner.IrExpressionInterpreter$Visitor.visitCall(IrExpressionInterpreter.java:632)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants