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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to