greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

feat:aggregate_diff value sub

Open clickme-zxy opened this issue 3 years ago • 2 comments

when write aggregate diff, (https://numpy.org/doc/stable/reference/generated/numpy.diff.html) the aggregate diff will sub the two value and panic "attmpt to panic sub overflow"

the value we has is :i8、i6、i32 、i64 when come to i64, the aggregate will panic of overflow(since the largest value type is i64)

so implement the value sub so to avoid the panic

clickme-zxy avatar Aug 24 '22 03:08 clickme-zxy

Arithmetic overflow is a global issue all around our codes. We should find a global way to handle it adequately.

MichaelScofield avatar Aug 24 '22 04:08 MichaelScofield

Two possible ways I can think of right now are:

  1. Expanding our Value to support u128 and i128 primitive types, and make sure our column schema supports max to u64 and i64; then change the Primitive::LargestType of u64 and i64 to u128 and i128.
  2. Handling overflow error globally, which requires a global error handler somewhere.

MichaelScofield avatar Aug 24 '22 04:08 MichaelScofield

@MichaelScofield @clickme-zxy, could you provide a reproduction so that we can understand the issue more intuitively?

Said a SQL that encounters error while it should not be.

tisonkun avatar Feb 17 '24 07:02 tisonkun

@tisonkun create another issue https://github.com/GreptimeTeam/greptimedb/issues/3385 for this.

MichaelScofield avatar Feb 26 '24 07:02 MichaelScofield

Close as superceded by #3385

MichaelScofield avatar Feb 26 '24 07:02 MichaelScofield