Skip to content

Commit

Permalink
add doc + fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xxhZs committed Dec 25, 2024
1 parent f1cb8ab commit d09d463
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e_test/batch/types/timestamp_ns.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ 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.123456000
1 2013-01-01 01:01:01.123456789
4 2213-01-01 01:01:01.123456789
2 2012-01-01 01:01:01.123456000

Expand Down
7 changes: 5 additions & 2 deletions src/common/src/types/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,11 @@ impl Time {
}
}

/// document about old and new format, including the meaning of highest 2 bits, and the corresponding accepted ranges.
/// The enumeration holds the correct value, which will be added(removed) to highest 2 bits when calling `to_protobuf` and `from_protobuf` methods
// The first 64 bits of protobuf encoding for `Timestamp` type has 2 possible meanings.
// * When the highest 2 bits are `11` or `00` (i.e. values ranging from `0b1100...00` to `0b0011..11`),
// it is *microseconds* since 1970-01-01 midnight. 2^62 microseconds covers 146235 years.
// * When the highest 2 bits are `10` or `01`, we flip the second bit to get values from `0b1100...00` to `0b0011..11` again.
// It is *seconds* since 1970-01-01 midnight. It is then followed by another 32 bits as nanoseconds within a second.
enum FirstI64 {
V0 { usecs: i64 },
V1 { secs: i64 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ impl HummockVersion {
.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 _
>= CompatibilityVersion::NoMemberTableIds as i32
{
self.state_table_info
.compaction_group_member_table_ids(*compaction_group_id)
Expand All @@ -508,7 +508,8 @@ impl HummockVersion {
BTreeSet::from_iter(group_construct.table_ids.clone())
};

if group_construct.version >= CompatibilityVersion::SplitGroupByTableId as _
if group_construct.version
>= CompatibilityVersion::SplitGroupByTableId as i32
{
let split_key = if group_construct.split_key.is_some() {
Some(Bytes::from(group_construct.split_key.clone().unwrap()))
Expand Down

0 comments on commit d09d463

Please sign in to comment.