Min-Young Wu created ARROW-18438:
------------------------------------

             Summary: [Go] firstTimeBitmapWriter.Finish() panics with 8n structs
                 Key: ARROW-18438
                 URL: https://issues.apache.org/jira/browse/ARROW-18438
             Project: Apache Arrow
          Issue Type: Bug
          Components: Go, Parquet
    Affects Versions: 10.0.1
            Reporter: Min-Young Wu


Even after [ARROW-17169|https://issues.apache.org/jira/browse/ARROW-17169] I 
still get a panic at the same location.

Below is a test case that panics:
{code:go}
func (ps *ParquetIOTestSuite) TestStructWithNullableListOfStructs() {
        bldr := array.NewStructBuilder(memory.DefaultAllocator, arrow.StructOf(
                arrow.Field{
                        Name: "l",
                        Type: arrow.ListOf(arrow.StructOf(
                                arrow.Field{Name: "a", Type: 
arrow.BinaryTypes.String},
                        )),
                },
        ))
        defer bldr.Release()

        lBldr := bldr.FieldBuilder(0).(*array.ListBuilder)
        stBldr := lBldr.ValueBuilder().(*array.StructBuilder)
        aBldr := stBldr.FieldBuilder(0).(*array.StringBuilder)

        bldr.AppendNull()
        bldr.Append(true)
        lBldr.Append(true)
        for i := 0; i < 8; i++ {
                stBldr.Append(true)
                aBldr.Append(strconv.Itoa(i))
        }

        arr := bldr.NewArray()
        defer arr.Release()

        field := arrow.Field{Name: "x", Type: arr.DataType(), Nullable: true}
        expected := array.NewTable(arrow.NewSchema([]arrow.Field{field}, nil),
                []arrow.Column{*arrow.NewColumn(field, 
arrow.NewChunked(field.Type, []arrow.Array{arr}))}, -1)
        defer expected.Release()

        ps.roundTripTable(expected, false)
}
{code}

I've tried to trim down the input data and this is as minimal as I could get 
it. And yes:
* wrapping struct with initial null is required
* the inner list needs to contain 8 structs (or any multiple of 8)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to