You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "alexeykudinkin (via GitHub)" <gi...@apache.org> on 2023/01/28 02:40:51 UTC
[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #7768: [HUDI-5630] Fixing flaky parquet projection tests
alexeykudinkin commented on code in PR #7768:
URL: https://github.com/apache/hudi/pull/7768#discussion_r1089603230
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestParquetColumnProjection.scala:
##########
@@ -327,7 +328,9 @@ class TestParquetColumnProjection extends SparkClientFunctionalTestHarness with
assertEquals(expectedRecordCount, rows.length)
if (expectedBytesRead != -1) {
- assertEquals(expectedBytesRead, bytesRead)
+ // verify within 10% of margin.
+ val ten_perc: Double = expectedBytesRead * 0.1;
Review Comment:
Naming should be camel-case
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestParquetColumnProjection.scala:
##########
@@ -327,7 +328,9 @@ class TestParquetColumnProjection extends SparkClientFunctionalTestHarness with
assertEquals(expectedRecordCount, rows.length)
if (expectedBytesRead != -1) {
- assertEquals(expectedBytesRead, bytesRead)
+ // verify within 10% of margin.
+ val ten_perc: Double = expectedBytesRead * 0.1;
+ assertTrue((expectedBytesRead + ten_perc) >= bytesRead && bytesRead >= (expectedBytesRead - ten_perc))
Review Comment:
Ratio is more intuitive: `(abs(expectedBytes - bytesRead) / expectedBytes) < 0.1`
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org