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

Error when trying to use the DATE_BIN function #584

Closed
stanvanrooy opened this issue Dec 22, 2023 · 8 comments
Closed

Error when trying to use the DATE_BIN function #584

stanvanrooy opened this issue Dec 22, 2023 · 8 comments
Assignees

Comments

@stanvanrooy
Copy link
Contributor

This query:

SELECT COUNT(*) as successful_logins, DATE_BIN('15 minutes', p_timestamp) as time 
FROM backend
GROUP BY time

Gives me the following error message:

Query execution failed due to Query Execution failed due to error in datafusion: push_down_projection caused by Internal error: Optimizer rule 'push_down_projection' 
failed, due to generate a different schema, 

original schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name: "successful_logins", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, DFField { qualifier: None, field: Field { name: "time", data_type: Timestamp(Millisecond, None), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }], metadata: {} }, 

new schema: DFSchema      { fields: [DFField { qualifier: None, field: Field { name: "successful_logins", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, DFField { qualifier: None, field: Field { name: "time", data_type: Timestamp(Nanosecond, None), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }], metadata: {} }. 

This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

It seems like the timestamp changes precision from ms to ns. I'm not sure if I should file this bug with you guys or directly with Datafusion.

@nitisht
Copy link
Member

nitisht commented Dec 22, 2023

cc @trueleo

@nitisht
Copy link
Member

nitisht commented Dec 22, 2023

We'll take a look shortly @stanvanrooy

@trueleo
Copy link
Contributor

trueleo commented Dec 22, 2023

@stanvanrooy Can you tell us which version of parseable you are running.

@stanvanrooy
Copy link
Contributor Author

@trueleo, I'm still on an older version: v0.6.2

@nitisht nitisht assigned trueleo and unassigned trueleo Dec 22, 2023
@stanvanrooy
Copy link
Contributor Author

@trueleo I don't want to be pushy, but is there any update? Is there a work-around? Or is this already fixed in a newer version? DATE_BIN is super useful, so it is a shame it can't be used right now.

@nitisht
Copy link
Member

nitisht commented Mar 4, 2024

We'll take a look soon @stanvanrooy

@nitisht nitisht added this to the Release v0.9.1 milestone Mar 5, 2024
@nitisht
Copy link
Member

nitisht commented Mar 6, 2024

@stanvanrooy can you try the latest release? Seems like query is working Here is the datafusion docs on date_bin https://arrow.apache.org/datafusion/user-guide/sql/scalar_functions.html#date-bin

@nitisht
Copy link
Member

nitisht commented Apr 12, 2024

Closing for now, assuming it works for you @stanvanrooy . Feel free to reopen if there are issues.

@nitisht nitisht closed this as completed Apr 12, 2024
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

4 participants