manishmalhotrawork commented on a change in pull request #365: test cases for 
parquetMetrics with multiple rowgroup
URL: https://github.com/apache/incubator-iceberg/pull/365#discussion_r312770857
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
 ##########
 @@ -270,6 +276,141 @@ public void testMetricsForNullColumns() throws 
IOException {
     assertBounds(1, IntegerType.get(), null, null, metrics);
   }
 
+  @Test
+  public void testMetricsForTopLevelWithMultipleRG() throws Exception {
+    Schema schema = getSimpleSchema();
+    int minimumRowGroupRecordCount = 100;
+    List<GenericData.Record> records = new ArrayList<>(201);
+
+    GenericData.Record firstRecord = new 
GenericData.Record(AvroSchemaUtil.convert(schema.asStruct()));
+    firstRecord.put("booleanCol", true);
+    firstRecord.put("intCol", 1);
+    // adding 1st element as null
+    firstRecord.put("longCol", null);
+    firstRecord.put("floatCol", 1.0F);
+    // adding 1st element as null
+    firstRecord.put("doubleCol", null);
+    // adding 1st element as null
+    firstRecord.put("decimalCol", null);
+    firstRecord.put("stringCol", "AAA");
+    firstRecord.put("dateCol", 1);
+    firstRecord.put("timeCol", 1L);
+    firstRecord.put("timestampCol", 1L);
+    firstRecord.put("uuidCol", uuid);
+    firstRecord.put("fixedCol", fixed);
+    firstRecord.put("binaryCol", "S".getBytes());
+    records.add(firstRecord);
 
 Review comment:
   refactored as per suggestion, please check.
   
   Actually initially I use ternary operator for multiple lines, and that 
result into cyclo-matic complexity = 14 , which is suppose to be 12 as per our 
checkstyle rule.
   So, to keep it simple added first record. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to