zeroshade commented on code in PR #477: URL: https://github.com/apache/arrow-go/pull/477#discussion_r2282774597
########## parquet/file/file_reader_test.go: ########## @@ -927,3 +928,61 @@ func TestListColumns(t *testing.T) { } } } + +func BenchmarkReadInt32Column(b *testing.B) { + b.Skip("rle-dict-int32-snappy.parquet not available") + + dir := os.Getenv("PARQUET_TEST_DATA") + if dir == "" { + dir = "../../parquet-testing/data" + b.Log("PARQUET_TEST_DATA not set, using ../../parquet-testing/data") + } + require.DirExists(b, dir) + + filePath := filepath.Join(dir, "rle-dict-int32-snappy.parquet") + reader, err := file.OpenParquetFile(filePath, false) + if err != nil { + b.Fatalf("Expected no error while opening parquet file %q, got %v", filePath, err) + } + defer reader.Close() + + int32ColIdx := reader.MetaData().Schema.Root().FieldIndexByName("int32") + if int32ColIdx < 0 { + b.Fatalf("Expected to find int32 column in schema, got index %d", int32ColIdx) + } + + numValues := reader.NumRows() + values := make([]int32, numValues) + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + startIndex := 0 + for rg := 0; rg < reader.NumRowGroups(); rg++ { + b.StopTimer() Review Comment: Swap this with the line above it -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org