ColinLeeo commented on code in PR #18869:
URL: https://github.com/apache/iotdb/pull/18869#discussion_r4322427904
##########
integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java:
##########
@@ -388,19 +392,22 @@ public void testNestExplain2() throws SQLException {
statement.execute("USE testdb");
// explain
- ResultSet resultSet = statement.executeQuery(sql);
- ResultSetMetaData metaData = resultSet.getMetaData();
- assertEquals(metaData.getColumnCount(), 1);
- assertEquals(metaData.getColumnName(1), "distribution plan");
-
- StringBuilder sb = new StringBuilder();
- while (resultSet.next()) {
- sb.append(resultSet.getString(1)).append(System.lineSeparator());
+ try (ResultSet clusterResult = statement.executeQuery(sql)) {
+ for (ResultSet resultSet : getExplainResultSets(sql, clusterResult)) {
+ ResultSetMetaData metaData = resultSet.getMetaData();
+ assertEquals(metaData.getColumnCount(), 1);
+ assertEquals(metaData.getColumnName(1), "distribution plan");
+
+ StringBuilder sb = new StringBuilder();
+ while (resultSet.next()) {
+ sb.append(resultSet.getString(1)).append(System.lineSeparator());
+ }
+ String result = sb.toString();
+ assertTrue(result.contains("CTE Query : 'cte1'"));
+ assertTrue(result.contains("CTE Query : 'cte2'"));
+ assertTrue(result.contains("Main Query"));
+ }
Review Comment:
should remove these modification.
--
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]