siddharthteotia commented on a change in pull request #6710:
URL: https://github.com/apache/incubator-pinot/pull/6710#discussion_r604385506
##########
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:
let's also add test cases for
- v3 data table sent by server is empty
- v3 data table sent by server has metadata length as 0
--
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]