Skip to content

Commit

Permalink
fix: query on stream with time partition (#886)
Browse files Browse the repository at this point in the history
version v.0.9.0 - time partition was stored as Utf-8
in version 1.3.0 onwards - time partition is now stored 
as TimestampMillisecond. After migration, time partition 
gets converted from Utf-8 to TimestmapNanosecond

fix is to match TimestampNanosecond to create the time 
filters for query
  • Loading branch information
nikhilsinhaparseable authored Aug 13, 2024
1 parent fef8f6d commit 6daf9e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/src/query/stream_schema_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ fn extract_from_lit(expr: BinaryExpr, time_partition: Option<String>) -> Option<
ScalarValue::TimestampMillisecond(Some(value), _) => {
Some(DateTime::from_timestamp_millis(value).unwrap().naive_utc())
}
ScalarValue::TimestampNanosecond(Some(value), _) => {
Some(DateTime::from_timestamp_nanos(value).naive_utc())
}
ScalarValue::Utf8(Some(str_value)) => {
if time_partition.is_some() && column_name == time_partition.unwrap() {
Some(str_value.parse::<NaiveDateTime>().unwrap())
Expand Down

0 comments on commit 6daf9e1

Please sign in to comment.