Conversation
Signed-off-by: discord9 <discord9@163.com>
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to extract timestamp ranges from predicates where the time index column is cast to milliseconds. It adds the get_casted_timestamp_filter function and supporting utilities to handle various comparison operators and literal-left expressions, accompanied by unit tests. A review comment suggests simplifying verbose type paths for DataType and TimeUnit by using the existing arrow alias to improve code readability.
| if !matches!( | ||
| &cast.data_type, | ||
| datatypes::arrow::datatypes::DataType::Timestamp( | ||
| datatypes::arrow::datatypes::TimeUnit::Millisecond, | ||
| None | ||
| ) | ||
| ) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
The type paths for DataType and TimeUnit are unnecessarily verbose. Since datatypes::arrow is imported as arrow at the top of the file, you can use arrow::datatypes::DataType and arrow::datatypes::TimeUnit directly to improve readability.
if !matches!(
&cast.data_type,
arrow::datatypes::DataType::Timestamp(arrow::datatypes::TimeUnit::Millisecond, None)
) {
return false;
}Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#7913 could be one way to fix it, could use together with #7926
What's changed and what's your intention?
support
cast(<time index>) <op> <literal>filter in table scan, deal with different precision&off by one errorTODO: more tests
PR Checklist
Please convert it to a draft if some of the following conditions are not met.