-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-17276: [Go][Integration] Implement IPC handling for union type #13806
Conversation
Pinging @wolfeidau for the last in this series of changes to get Go support for data types :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things and suggestions.
Again this is pretty amazing work.
Thanks for the lookover @wolfeidau ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Some comments below, but looks good generally.
if arr.Offset == nil { | ||
offsets = []byte{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that actually happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It happens in the case of an empty array, which i found when it crashed during archery integration testing lol.
|
||
switch field.Length() { | ||
case 0: | ||
buffers = append(buffers, memory.NewBufferBytes([]byte{})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the type codes buffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. In the case of an empty array the type codes buffer is empty.
for i, c := range codes { | ||
if offsets[c] == -1 { | ||
// offsets are guaranteed to be increasing according to the spec | ||
// so the first offset we find for a child is the initial offset | ||
// and will become the "0" for this child. | ||
offsets[c] = unshiftedOffsets[i] | ||
shiftedOffsets[i] = 0 | ||
} else { | ||
shiftedOffsets[i] = unshiftedOffsets[i] - offsets[c] | ||
} | ||
lengths[c] = maxI32(lengths[c], shiftedOffsets[i]+1) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! This may serve as an inspiration for Arrow C++, in turn :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Benchmark runs are scheduled for baseline = b1d36c0 and contender = d171b6c. d171b6c is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
With this, the Go implementation finally fully supports IPC handling for All the Arrow DataTypes!