diff --git a/e2e_test/batch/types/timestamp_ns.slt.part b/e2e_test/batch/types/timestamp_ns.slt.part index d5fc03385063b..a5888d1e2f418 100644 --- a/e2e_test/batch/types/timestamp_ns.slt.part +++ b/e2e_test/batch/types/timestamp_ns.slt.part @@ -7,21 +7,21 @@ create table t1(v1 int, v2 timestamp); statement ok insert into t1 values(1,'2013-01-01 01:01:01.123456789'),(2,'2012-01-01 01:01:01.123456'),(3,'0000-01-01 01:01:01.123456789'),(4,'2213-01-01 01:01:01.123456789'),(5,null); -query T +query T rowsort select * from t1; ---- -3 0001-01-01 01:01:01.123456789 BC -5 null 1 2013-01-01 01:01:01.123456789 -4 2213-01-01 01:01:01.123456789 2 2012-01-01 01:01:01.123456 +3 0001-01-01 01:01:01.123456789 BC +4 2213-01-01 01:01:01.123456789 +5 null query T select * from t1 where v1 is null; ---- 5 null -query T +query T rowsort select v1, v2, case when extract(year from v2) < 2000 then 'Before 2000' @@ -30,79 +30,79 @@ case end as time_period from t1; ---- -2 2012-01-01 01:01:01.123456 21st Century 1 2013-01-01 01:01:01.123456789 21st Century -4 2213-01-01 01:01:01.123456789 Future +2 2012-01-01 01:01:01.123456 21st Century 3 0001-01-01 01:01:01.123456789 BC Before 2000 +4 2213-01-01 01:01:01.123456789 Future 5 null Future -query T +query T rowsort select v1, v2, coalesce(v2, '1900-01-01 00:00:00') as coalesce_v2 from t1; ---- -3 0001-01-01 01:01:01.123456789 BC 0001-01-01 01:01:01.123456789 BC -5 null 1900-01-01 00:00:00 1 2013-01-01 01:01:01.123456789 2013-01-01 01:01:01.123456789 -4 2213-01-01 01:01:01.123456789 2213-01-01 01:01:01.123456789 2 2012-01-01 01:01:01.123456 2012-01-01 01:01:01.123456 +3 0001-01-01 01:01:01.123456789 BC 0001-01-01 01:01:01.123456789 BC +4 2213-01-01 01:01:01.123456789 2213-01-01 01:01:01.123456789 +5 null 1900-01-01 00:00:00 query T select count(v2) as total_rows from t1; ---- 4 -query T +query T rowsort select * from t1 order by v2; ---- -3 0001-01-01 01:01:01.123456789 BC -2 2012-01-01 01:01:01.123456 1 2013-01-01 01:01:01.123456789 +2 2012-01-01 01:01:01.123456 +3 0001-01-01 01:01:01.123456789 BC 4 2213-01-01 01:01:01.123456789 5 null -query T +query T rowsort select * from t1 where v2 >= '2012-01-01 01:01:01.123456'; ---- -2 2012-01-01 01:01:01.123456 1 2013-01-01 01:01:01.123456789 +2 2012-01-01 01:01:01.123456 4 2213-01-01 01:01:01.123456789 -query T +query T rowsort select v1, cast(v2 as date) as date_v2, cast(v2 as timestamp with time zone) as timestamptz_v2 from t1; ---- -3 0001-01-01 BC 0001-01-01 01:01:01.123456+00:00 BC -5 null null 1 2013-01-01 2013-01-01 01:01:01.123456+00:00 -4 2213-01-01 2213-01-01 01:01:01.123456+00:00 2 2012-01-01 2012-01-01 01:01:01.123456+00:00 +3 0001-01-01 BC 0001-01-01 01:01:01.123456+00:00 BC +4 2213-01-01 2213-01-01 01:01:01.123456+00:00 +5 null null -query T +query T rowsort select v1, date_trunc('day', v2) AS truncated_v2 from t1; ---- -3 0001-01-01 00:00:00 BC -5 null -2 2012-01-01 00:00:00 1 2013-01-01 00:00:00 +2 2012-01-01 00:00:00 +3 0001-01-01 00:00:00 BC 4 2213-01-01 00:00:00 +5 null -query T +query T rowsort select v1, v2 at time zone 'UTC' as v2_utc from t1; ---- -3 0001-01-01 01:01:01.123456+00:00 BC -5 null 1 2013-01-01 01:01:01.123456+00:00 -4 2213-01-01 01:01:01.123456+00:00 2 2012-01-01 01:01:01.123456+00:00 +3 0001-01-01 01:01:01.123456+00:00 BC +4 2213-01-01 01:01:01.123456+00:00 +5 null -query T +query T rowsort select v1, to_char(v2, 'YYYY-MM-DD HH24:MI:SS.NS') as formatted_v2 from t1; ---- -3 0001-01-01 01:01:01.123456789 BC -5 null 1 2013-01-01 01:01:01.123456789 -4 2213-01-01 01:01:01.123456789 2 2012-01-01 01:01:01.123456000 +3 0001-01-01 01:01:01.123456789 BC +4 2213-01-01 01:01:01.123456789 +5 null -query T +query T rowsort select generate_series('2013-01-01 01:01:01.123456789'::timestamp,'2013-01-01 01:01:05.123456790'::timestamp, '1 s'); ---- 2013-01-01 01:01:01.123456789 diff --git a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs index 591b4f956b008..a3a79b0d12b3c 100644 --- a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs +++ b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs @@ -494,8 +494,8 @@ impl HummockVersion { .member_table_ids .clone_from(&group_construct.table_ids); self.levels.insert(*compaction_group_id, new_levels); - let member_table_ids = if group_construct.version - >= CompatibilityVersion::NoMemberTableIds as i32 + let member_table_ids = if group_construct.version() + >= CompatibilityVersion::NoMemberTableIds { self.state_table_info .compaction_group_member_table_ids(*compaction_group_id) @@ -508,9 +508,7 @@ impl HummockVersion { BTreeSet::from_iter(group_construct.table_ids.clone()) }; - if group_construct.version - >= CompatibilityVersion::SplitGroupByTableId as i32 - { + if group_construct.version() >= CompatibilityVersion::SplitGroupByTableId { let split_key = if group_construct.split_key.is_some() { Some(Bytes::from(group_construct.split_key.clone().unwrap())) } else {