walterddr commented on code in PR #10583: URL: https://github.com/apache/pinot/pull/10583#discussion_r1161121341
########## pinot-core/src/test/java/org/apache/pinot/core/common/datatable/DataTableSerDeTest.java: ########## @@ -123,36 +123,142 @@ public void testException(int dataTableVersion) } @Test(dataProvider = "versionProvider") - public void testEmptyStrings(int dataTableVersion) + public void testEmptyValues(int dataTableVersion) throws IOException { DataTableBuilderFactory.setDataTableVersion(dataTableVersion); String emptyString = StringUtils.EMPTY; String[] emptyStringArray = {StringUtils.EMPTY}; + ByteArray emptyBytes = new ByteArray(new byte[0]); + for (int numRows = 0; numRows < NUM_ROWS; numRows++) { + testEmptyValues(new DataSchema(new String[]{"STR_SV", "STR_MV"}, new DataSchema.ColumnDataType[]{ Review Comment: i dont know if this is possible but lets also test empty `OBJECT` type? ########## pinot-core/src/test/java/org/apache/pinot/core/common/datatable/DataTableSerDeTest.java: ########## @@ -123,36 +123,142 @@ public void testException(int dataTableVersion) } @Test(dataProvider = "versionProvider") - public void testEmptyStrings(int dataTableVersion) + public void testEmptyValues(int dataTableVersion) throws IOException { DataTableBuilderFactory.setDataTableVersion(dataTableVersion); String emptyString = StringUtils.EMPTY; String[] emptyStringArray = {StringUtils.EMPTY}; + ByteArray emptyBytes = new ByteArray(new byte[0]); + for (int numRows = 0; numRows < NUM_ROWS; numRows++) { + testEmptyValues(new DataSchema(new String[]{"STR_SV", "STR_MV"}, new DataSchema.ColumnDataType[]{ + DataSchema.ColumnDataType.STRING, DataSchema.ColumnDataType.STRING_ARRAY + }), numRows, new Object[]{emptyString, emptyStringArray}); + + testEmptyValues( + new DataSchema(new String[]{"STR_SV"}, new DataSchema.ColumnDataType[]{DataSchema.ColumnDataType.STRING}), + numRows, new Object[]{emptyString}); + + testEmptyValues(new DataSchema(new String[]{"STR_MV"}, + new DataSchema.ColumnDataType[]{DataSchema.ColumnDataType.STRING_ARRAY}), numRows, + new Object[]{emptyStringArray}); + + testEmptyValues( + new DataSchema(new String[]{"BYTES"}, new DataSchema.ColumnDataType[]{DataSchema.ColumnDataType.BYTES}), + numRows, new Object[]{emptyBytes}); + + testEmptyValues( + new DataSchema(new String[]{"BOOL_ARR"}, + new DataSchema.ColumnDataType[]{DataSchema.ColumnDataType.BOOLEAN_ARRAY}), + numRows, new Object[]{new int[]{}}); + + testEmptyValues( Review Comment: why is this one initialized with a `{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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org