parseable
parseable copied to clipboard
Error when trying to use the DATE_BIN function
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.
cc @trueleo
We'll take a look shortly @stanvanrooy
@stanvanrooy Can you tell us which version of parseable you are running.
@trueleo, I'm still on an older version: v0.6.2
@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.
We'll take a look soon @stanvanrooy
@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
Closing for now, assuming it works for you @stanvanrooy . Feel free to reopen if there are issues.