zeroshade commented on code in PR #820:
URL: https://github.com/apache/iceberg-go/pull/820#discussion_r3005145402
##########
table/arrow_utils.go:
##########
@@ -973,11 +973,25 @@ func (a *arrowProjectionVisitor) Struct(st
iceberg.StructType, structArr arrow.A
arr =
array.MakeArrayOfNull(compute.GetAllocator(a.ctx), dt, structArr.Len())
}
+ defer arr.Release()
Review Comment:
Were we seeing an actual memory leak happening? We already have a defer
release above when needed, but otherwise let it get released by the subsequent
steps.
##########
table/arrow_utils.go:
##########
@@ -973,11 +973,25 @@ func (a *arrowProjectionVisitor) Struct(st
iceberg.StructType, structArr arrow.A
arr =
array.MakeArrayOfNull(compute.GetAllocator(a.ctx), dt, structArr.Len())
}
+ defer arr.Release()
+ fieldArrs[i] = arr
+ fields[i] = a.constructField(field, arr.DataType())
+ } else if field.WriteDefault != nil && a.useWriteDefault {
Review Comment:
Can we break out and join the logic at line 968 for the non-required field
rather than duplicating it here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]