Skip to content

Commit eb19759

Browse files
committed
test(iceberg): Fix disabled iceberg row group bytes test
1 parent dd512bc commit eb19759

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

backends-velox/src-iceberg/test/scala/org/apache/gluten/execution/enhanced/VeloxIcebergSuite.scala

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ class VeloxIcebergSuite extends IcebergSuite {
655655
}
656656

657657
// Ignored due to velox parquet row-group flush semantics change after velox#16998.
658-
ignore("iceberg parquet writer default row group size test") {
658+
test("iceberg parquet writer default row group size test") {
659659
val table = "iceberg_default_row_group_size"
660660
val defaultRowGroupBytes = 128L * 1024 * 1024
661661

@@ -743,19 +743,35 @@ class VeloxIcebergSuite extends IcebergSuite {
743743
checkAnswer(
744744
spark.sql(s"SELECT count(*) FROM $table"),
745745
Seq(Row(90000L)))
746-
val rowGroups = collectRowGroups(table)
746+
val rowGroups =
747+
collectRowGroups(table).sortBy(info => (info.file, info.ordinal))
748+
749+
assert(
750+
rowGroups.map(_.file).distinct.size == 1,
751+
s"Expected one Parquet file, found: ${rowGroups.map(_.file).distinct}")
747752

748753
assert(
749754
rowGroups.size == 2,
750-
"Expected 2 row groups")
755+
s"Expected 2 row groups, found ${rowGroups.size}: $rowGroups")
751756

752757
assert(
753-
rowGroups.head.totalByteSize < defaultRowGroupBytes,
754-
"Expected row group to contain less than default value")
758+
rowGroups.map(_.rowCount).sum == 90000L,
759+
s"Expected 90000 rows across all row groups: $rowGroups")
760+
761+
val firstRowGroup = rowGroups.head
762+
val finalRowGroup = rowGroups.last
755763

756764
assert(
757-
rowGroups(1).totalByteSize < defaultRowGroupBytes,
758-
"Expected row group to contain less than default value")
765+
firstRowGroup.compressedSize >= defaultRowGroupBytes,
766+
s"Expected the first row group to reach the default row-group size " +
767+
s"$defaultRowGroupBytes, but found ${firstRowGroup.compressedSize}"
768+
)
769+
770+
assert(
771+
finalRowGroup.compressedSize < defaultRowGroupBytes,
772+
s"Expected the final row group to be smaller than the default row-group " +
773+
s"size $defaultRowGroupBytes, but found ${finalRowGroup.compressedSize}"
774+
)
759775
}
760776
}
761777
}

0 commit comments

Comments
 (0)