Skip to content

Commit

Permalink
apacheGH-35133: [Go] fix for math.MaxUint32 overflows int error in …
Browse files Browse the repository at this point in the history
…32-bit arch (apache#35159)

### Rationale for this change

When compiling on i386 arch, an error like `math.MaxUint32 (untyped int constant 4294967295) overflows int` will appear. The Int type is 32-bit and in 32-bit arch it overflows. In my PR, I cast `int` to `unint` to avoid this error.

* Closes: apache#35133

Authored-by: sunpeng <sunpeng.dev@gmail.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
  • Loading branch information
sunpe authored and ArgusLi committed May 15, 2023
1 parent 90fbbb4 commit b4192c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/arrow/array/dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ func (u *unifier) GetResultWithIndexType(indexType arrow.DataType) (arrow.Array,
case arrow.INT16:
toobig = dictLen > math.MaxInt16
case arrow.UINT32:
toobig = dictLen > math.MaxUint32
toobig = uint(dictLen) > math.MaxUint32
case arrow.INT32:
toobig = dictLen > math.MaxInt32
case arrow.UINT64:
Expand Down

0 comments on commit b4192c6

Please sign in to comment.