Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
fxi ci

fix ci

fix ci
  • Loading branch information
xxhZs committed Dec 26, 2024
1 parent d09d463 commit 2c87c76
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 42 deletions.
74 changes: 37 additions & 37 deletions e2e_test/batch/types/timestamp_ns.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -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;
select * from t1 where v2 is null;
----
5 null
5 NULL

query T
query T rowsort
select v1, v2,
case
when extract(year from v2) < 2000 then 'Before 2000'
Expand All @@ -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
5 null Future
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
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 0000-01-01 01:01:01.123456789
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 2c87c76

Please sign in to comment.