mcvsubbu commented on a change in pull request #6710:
URL: https://github.com/apache/incubator-pinot/pull/6710#discussion_r605165539



##########
File path: 
pinot-core/src/test/java/org/apache/pinot/core/common/datatable/DataTableSerDeTest.java
##########
@@ -96,22 +99,130 @@ public void testAllDataTypes()
     for (int i = 0; i < numColumns; i++) {
       columnNames[i] = columnDataTypes[i].name();
     }
-    DataSchema dataSchema = new DataSchema(columnNames, columnDataTypes);
 
+    int[] ints = new int[NUM_ROWS];
+    long[] longs = new long[NUM_ROWS];
+    float[] floats = new float[NUM_ROWS];
+    double[] doubles = new double[NUM_ROWS];
+    String[] strings = new String[NUM_ROWS];
+    byte[][] bytes = new byte[NUM_ROWS][];
+    Object[] objects = new Object[NUM_ROWS];
+    int[][] intArrays = new int[NUM_ROWS][];
+    long[][] longArrays = new long[NUM_ROWS][];
+    float[][] floatArrays = new float[NUM_ROWS][];
+    double[][] doubleArrays = new double[NUM_ROWS][];
+    String[][] stringArrays = new String[NUM_ROWS][];
+
+    DataSchema dataSchema = new DataSchema(columnNames, columnDataTypes);
     DataTableBuilder dataTableBuilder = new DataTableBuilder(dataSchema);
+    fillDataTableWithRandomData(dataTableBuilder, columnDataTypes, numColumns, 
ints, longs, floats, doubles, strings,
+        bytes, objects, intArrays, longArrays, floatArrays, doubleArrays, 
stringArrays);
+
+    DataTable dataTable = dataTableBuilder.build();
+    DataTable newDataTable = 
DataTableFactory.getDataTable(dataTable.toBytes());
+    Assert.assertEquals(newDataTable.getDataSchema(), dataSchema, 
ERROR_MESSAGE);
+    Assert.assertEquals(newDataTable.getNumberOfRows(), NUM_ROWS, 
ERROR_MESSAGE);
+    verifyDataIsSame(newDataTable, columnDataTypes, numColumns, ints, longs, 
floats, doubles, strings, bytes, objects,
+        intArrays, longArrays, floatArrays, doubleArrays, stringArrays);
+  }
+
+  @Test
+  public void testV2V3Compatibility()

Review comment:
       @mqliang the idea here is to make sure that the receiver handles things 
as much as possible even if sender does something weird (say, someone 
introduces a bug, or somehow the next rev of the protocol does something 
funky). See Robustmness principle: 
https://en.wikipedia.org/wiki/Robustness_principle




-- 
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]



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

Reply via email to