You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "wkalt (via GitHub)" <gi...@apache.org> on 2024/06/23 18:36:23 UTC

[I] [Go] type mismatch building record with fixed-length array [arrow]

wkalt opened a new issue, #43012:
URL: https://github.com/apache/arrow/issues/43012

   ### Describe the usage question you have. Please include as many useful details as  possible.
   
   
   Hello,
   Thanks for the library. I'm wondering what is wrong with the code below. I am struggling to build a record that includes a non-nullable fixed-size list.
   
   If I change the call to `FixedSizeListOfNonNullable` to `ListOfNonNullable` my panic goes away, so being fixed-size seems relevant.
   
   I'm not sure if this is a usage error or a bug, I'm just getting started with arrow.
   
   ```
   func TestExample(t *testing.T) {
   	pool := memory.NewGoAllocator()
   
   	schema := arrow.NewSchema([]arrow.Field{
   		{Name: "data", Type: arrow.FixedSizeListOfNonNullable(1, arrow.PrimitiveTypes.Int32)},
   	}, nil)
   
   	builder := array.NewRecordBuilder(pool, schema)
   
   	lb := builder.Field(0).(*array.FixedSizeListBuilder)
   
   	// append data to the value builder
   	vb := lb.ValueBuilder().(*array.Int32Builder)
   	vb.Append(10)
   
   	// why is the array that comes out of here nullable?
   	//_ = lb.NewArray()
   
   	// panic here
   	_ = builder.NewRecord()
   	// row/array: column "data" type mismatch: got=struct<foo: fixed_size_list<item: int32, nullable>[3]>, want=struct<foo: fixed_size_list<item: int32>[3]> [recovered]
   }
   ```
   
   ### Component(s)
   
   Go


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Go] type mismatch building record with fixed-length non-nullable array [arrow]

Posted by "wkalt (via GitHub)" <gi...@apache.org>.
wkalt commented on issue #43012:
URL: https://github.com/apache/arrow/issues/43012#issuecomment-2185270896

   It seems to me that any nullability context is getting dropped for fixed-length arrays here:
   
   https://github.com/apache/arrow/blob/main/go/arrow/array/builder.go#L358,L360
   
   Regular lists don't have this problem because they pass the entire field structure down to the list builder constructor. Fixed size arrays need the same "WithField" treatment introduced in 8bff490ce37f0bb427ad865fae6c1d29c18d9fa7.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org