jtao15 commented on a change in pull request #6224: URL: https://github.com/apache/incubator-pinot/pull/6224#discussion_r521667786
########## File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java ########## @@ -975,6 +831,197 @@ private static boolean isSelectionQuery(BrokerRequest brokerRequest) { return false; } + private static void convertToUpperCase(List<String> columns) { + for (int i = 0; i < columns.size(); i++) { + columns.set(i, columns.get(i).toUpperCase()); + } + } + + private static int getH2ExpectedValues(Set<String> expectedValues, List<String> expectedOrderByValues, + ResultSet h2ResultSet, ResultSetMetaData h2MetaData, Collection<String> orderByColumns) throws SQLException { + Map<String, String> reusableExpectedValueMap = new HashMap<>(); + Map<String, List<String>> reusableMultiValuesMap = new HashMap<>(); + List<String> reusableColumnOrder = new ArrayList<>(); + int h2NumRows; + int numColumns = h2MetaData.getColumnCount(); + + for (h2NumRows = 0; h2ResultSet.next() && h2NumRows < MAX_NUM_ROWS_TO_COMPARE; h2NumRows++) { + reusableExpectedValueMap.clear(); + reusableMultiValuesMap.clear(); + reusableColumnOrder.clear(); + + for (int columnIndex = 1; columnIndex <= numColumns; columnIndex++) { // h2 result set is 1-based + String columnName = h2MetaData.getColumnName(columnIndex); + + // Handle null result and convert boolean value to lower case + String columnValue = h2ResultSet.getString(columnIndex); + if (columnValue == null) { + columnValue = "null"; + } else { + columnValue = convertBooleanToLowerCase(columnValue); + } + + // Handle multi-value columns + int length = columnName.length(); + if (length > 5 && columnName.substring(length - 5, length - 1).equals("__MV")) { Review comment: 5 here is the length of h2 muti-value column suffix. A typical h2 multi-value column name will be 'NAME__MV0'. Maybe it's better to change it as a constant instead of number. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org