Skip to content

Conversation

@ciacono
Copy link
Collaborator

@ciacono ciacono commented Jul 17, 2025

No description provided.

@ciacono ciacono force-pushed the timestamps branch 3 times, most recently from 445809a to 41a51ba Compare July 18, 2025 22:35
HBase max timestamp is Long.MAX_VALUE. Sending timestamps greater
than this returns an IllegalArgumentException from HBase. Instead,
let's catch this earlier in the gohbase driver.
@ciacono ciacono marked this pull request as ready for review July 23, 2025 19:01
if !ok {
return errors.New("'TimestampUint64' option can only be used with mutation queries")
}
if ts > MaxTimestamp {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(GitHub is not allowing me to comment on lines that are not part of the diff, so I'm posting it here.)

In Timestamp you should also check the time. It's possible that the user passes in a time.Time that is before the unix epoch, which will end up being negative / a value greater than MaxTimestamp when converted to uint64.

hrpc/mutate.go Outdated

func (m *Mutate) toProto(isCellblocks bool, cbs [][]byte) (*pb.MutateRequest, [][]byte, uint32) {
var ts *uint64
if m.timestamp != MaxTimestamp {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was intentional behavior, though it looks odd. m.timestamp is set to MaxTimestamp (MaxUint64) by default during instantiation, which is meant to be interpreted as unset. So, that's why this code is not setting the pb value.
I think we may need to re-name MaxTimestamp to UnsetTimestamp and leave that as math.MaxUint64 then make MaxTimestamp be MaxInt64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants