You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Min-Young Wu (Jira)" <ji...@apache.org> on 2022/12/16 01:20:00 UTC

[jira] [Updated] (ARROW-18438) [Go] firstTimeBitmapWriter.Finish() panics with 8n structs

     [ https://issues.apache.org/jira/browse/ARROW-18438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Min-Young Wu updated ARROW-18438:
---------------------------------
    Description: 
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) TestStructWithListOf8Structs() {
	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)

  was:
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)


> [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
>            Priority: Critical
>
> 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) TestStructWithListOf8Structs() {
> 	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)