From 08e18e265dfb7e6e77c32244f56acd0f63bf4ead Mon Sep 17 00:00:00 2001 From: Kemal <223029+disq@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:48:52 +0100 Subject: [PATCH] fix(tests): WriterTestSuite.handleNulls should not overwrite columns (#1920) --- plugin/nulls.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/nulls.go b/plugin/nulls.go index 0332a09820..21dfa82726 100644 --- a/plugin/nulls.go +++ b/plugin/nulls.go @@ -93,10 +93,11 @@ func (s *WriterTestSuite) replaceNullsByEmptyNestedArray(arr arrow.Array) arrow. func (s *WriterTestSuite) handleNulls(record arrow.Record) arrow.Record { cols := record.Columns() + newCols := make([]arrow.Array, len(cols)) for c, col := range cols { - cols[c] = s.handleNullsArray(col) + newCols[c] = s.handleNullsArray(col) } - return array.NewRecord(record.Schema(), cols, record.NumRows()) + return array.NewRecord(record.Schema(), newCols, record.NumRows()) } func (s *WriterTestSuite) handleNullsArray(arr arrow.Array) arrow.Array {