Copilot commented on code in PR #17284:
URL: https://github.com/apache/pinot/pull/17284#discussion_r2572631316
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/ArrayTest.java:
##########
@@ -234,32 +233,41 @@ public void testListAggQueries(boolean
useMultiStageQueryEngine)
query =
String.format("SELECT "
- + "listAgg(stringCol, ' | ') WITHIN GROUP (ORDER BY stringCol) "
- + "FROM %s LIMIT %d", getTableName(), getCountStarResult());
+ + "listAgg(stringCol, ' | ') WITHIN GROUP (ORDER BY stringCol),
intCol "
+ + "FROM %s GROUP BY intCol LIMIT %d", getTableName(),
getCountStarResult());
jsonNode = postQuery(query);
rows = jsonNode.get("resultTable").get("rows");
- assertEquals(rows.size(), 1);
- row = rows.get(0);
- assertEquals(row.size(), 1);
- String[] splits = row.get(0).asText().split(" \\| ");
- assertEquals(splits.length, getCountStarResult());
- for (int i = 1; i < splits.length; i++) {
- assertTrue(splits[i].compareTo(splits[i - 1]) >= 0);
+ assertEquals(rows.size(), getCountStarResult() / 10);
+ for (int rowId = 0; rowId < getCountStarResult() / 10; rowId++) {
+ row = rows.get(rowId);
+ assertEquals(row.size(), 2);
+ String[] splits = row.get(0).asText().split(" \\| ");
+ if (splits.length > 0) {
+ assertEquals(splits.length, 10);
+ for (int i = 1; i < splits.length; i++) {
+ assertTrue(splits[i].compareTo(splits[i - 1]) >= 0);
+ }
+ }
}
query =
String.format("SELECT "
- + "listAgg(cast(doubleCol AS VARCHAR), ' | ') WITHIN GROUP (ORDER
BY doubleCol) "
- + "FROM %s LIMIT %d", getTableName(), getCountStarResult());
+ + "listAgg(cast(doubleCol AS VARCHAR), ' | ') WITHIN GROUP (ORDER
BY doubleCol), stringCol "
+ + "FROM %s GROUP BY stringCol LIMIT %d", getTableName(),
getCountStarResult());
jsonNode = postQuery(query);
rows = jsonNode.get("resultTable").get("rows");
- assertEquals(rows.size(), 1);
- row = rows.get(0);
- assertEquals(row.size(), 1);
- splits = row.get(0).asText().split(" \\| ");
- assertEquals(splits.length, getCountStarResult());
- for (int i = 1; i < splits.length; i++) {
- assertTrue(Double.parseDouble(splits[i]) >= Double.parseDouble(splits[i
- 1]));
+ assertEquals(rows.size(), getCountStarResult() / 10);
+ for (int rowId = 0; rowId < getCountStarResult() / 10; rowId++) {
+ row = rows.get(rowId);
+ assertEquals(row.size(), 2);
+ System.out.println("row = " + row);
Review Comment:
Remove debug statement `System.out.println` before committing. Use SLF4J
logger instead if logging is needed.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/ArrayTest.java:
##########
@@ -341,32 +349,39 @@ public void testListDistinctAggQueries(boolean
useMultiStageQueryEngine)
query =
String.format("SELECT "
- + "listAgg(DISTINCT stringCol, ' | ') WITHIN GROUP (ORDER BY
stringCol) "
- + "FROM %s LIMIT %d", getTableName(), getCountStarResult());
+ + "listAgg(DISTINCT stringCol, ' | ') WITHIN GROUP (ORDER BY
stringCol), intCol "
+ + "FROM %s GROUP BY intCol LIMIT %d", getTableName(),
getCountStarResult());
jsonNode = postQuery(query);
rows = jsonNode.get("resultTable").get("rows");
- assertEquals(rows.size(), 1);
- row = rows.get(0);
- assertEquals(row.size(), 1);
- String[] splits = row.get(0).asText().split(" \\| ");
- assertEquals(splits.length, getCountStarResult() / 10);
- for (int j = 1; j < splits.length; j++) {
- assertTrue(splits[j].compareTo(splits[j - 1]) > 0);
+ assertEquals(rows.size(), getCountStarResult() / 10);
+ for (int rowId = 0; rowId < getCountStarResult() / 10; rowId++) {
+ row = rows.get(rowId);
+ assertEquals(row.size(), 2);
+ String[] splits = row.get(0).asText().split(" \\| ");
+ if (splits.length > 1) {
+ assertEquals(splits.length, getCountStarResult());
+ for (int i = 1; i < splits.length; i++) {
+ assertTrue(splits[i].compareTo(splits[i - 1]) >= 0);
+ }
+ }
}
query =
String.format("SELECT "
- + "listAgg(DISTINCT cast(doubleCol AS VARCHAR), ' | ') WITHIN
GROUP (ORDER BY doubleCol) "
- + "FROM %s LIMIT %d", getTableName(), getCountStarResult());
+ + "listAgg(DISTINCT cast(doubleCol AS VARCHAR), ' | ') WITHIN
GROUP (ORDER BY doubleCol), stringCol "
+ + "FROM %s GROUP BY stringCol LIMIT %d", getTableName(),
getCountStarResult());
jsonNode = postQuery(query);
rows = jsonNode.get("resultTable").get("rows");
- assertEquals(rows.size(), 1);
- row = rows.get(0);
- assertEquals(row.size(), 1);
- splits = row.get(0).asText().split(" \\| ");
- assertEquals(splits.length, getCountStarResult() / 10);
- for (int j = 1; j < splits.length; j++) {
- assertTrue(Double.parseDouble(splits[j]) > Double.parseDouble(splits[j -
1]));
+ assertEquals(rows.size(), getCountStarResult() / 10);
+ for (int rowId = 0; rowId < getCountStarResult() / 10; rowId++) {
+ row = rows.get(rowId);
+ System.out.println("row = " + row);
Review Comment:
Remove debug statement `System.out.println` before committing. Use SLF4J
logger instead if logging is needed.
```suggestion
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]