You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
array.(*DenseUnionBuilder).Len and array.(*SparseUnionBuilder).Len always return 0. They should instead return the number of values appended.
This bug exists because these methods are promoted (via unionBuilder) from (*builder).Len, which reads builder.length, but DenseUnionBuilder and SparseUnionBuilder don't update that field.
It is a problem because some nested type builders require working child builder Len methods. For example, at present, a ListBuilder for a union child type always builds empty lists and a MapBuilder for a union key type always builds empty maps.
One way to fix this is to add a (*unionBuilder).Len implementation that calls unionBuilder.typesBuilder.Len.
// Len returns the current number of elements in the builder.func (b*unionBuilder) Len() int { returnb.typesBuilder.Len() }
Component(s)
Go
The text was updated successfully, but these errors were encountered:
(*DenseUnionBuilder).Len and (*SparseUnionBuilder).Len always return 0. They should instead return the number of values appended.
This bug exists because these methods are promoted (via unionBuilder) from (*builder).Len, which reads builder.length, but DenseUnionBuilder and SparseUnionBuilder don't update that field.
Fix by adding a (*unionBuilder).Len implementation that calls unionBuilder.typesBuilder.Len.
Authored-by: Noah Treuhaft <noah.treuhaft@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Describe the bug, including details regarding any error messages, version, and platform.
array.(*DenseUnionBuilder).Len and array.(*SparseUnionBuilder).Len always return 0. They should instead return the number of values appended.
This bug exists because these methods are promoted (via unionBuilder) from (*builder).Len, which reads builder.length, but DenseUnionBuilder and SparseUnionBuilder don't update that field.
It is a problem because some nested type builders require working child builder Len methods. For example, at present, a ListBuilder for a union child type always builds empty lists and a MapBuilder for a union key type always builds empty maps.
One way to fix this is to add a (*unionBuilder).Len implementation that calls unionBuilder.typesBuilder.Len.
Component(s)
Go
The text was updated successfully, but these errors were encountered: