Skip to content

Commit d79cb52

Browse files
committed
sql/export: skip columns with Bit(0) type in parquet test
We were seeing failures on this randomized test when these columns were generated. The testutils parquet decoder can't handle this type (added in #132944) so these fail, but it doesn't represent a real issue. This fix skips these the randomly generated test cases that include this column type. Fixes: #154011 Epic: none Release note: None
1 parent bdf73fa commit d79cb52

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/sql/importer/exportparquet_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,22 @@ func TestRandomParquetExports(t *testing.T) {
229229
require.NoError(t, err)
230230

231231
for _, col := range cols {
232+
// Skip tables with BIT(0) columns (or arrays of BIT(0)).
233+
// The testutils parquet decoder cannot decode these as
234+
// into the expected empty bit array and decodes the as
235+
// nil. Ignore these to avoid these flakes.
236+
colTyp := col.Typ
237+
if colTyp.Family() == types.ArrayFamily {
238+
colTyp = colTyp.ArrayContents()
239+
}
240+
if colTyp.Family() == types.BitFamily && colTyp.Width() == 0 {
241+
// We skip these because of the aforementioned
242+
// decoder issue.
243+
t.Logf("skipping table '%s' because it has BIT(0) column '%s' (type: %s)",
244+
tableName, col.Name, colTyp.String())
245+
return fmt.Errorf("table has BIT(0) column")
246+
}
247+
232248
// TODO(#104278): don't call this function to check if a type is supported.
233249
// We should explicitly use the ones supported by util/parquet).
234250
_, err := parquet.NewSchema([]string{"test"}, []*types.T{col.Typ})

0 commit comments

Comments
 (0)