JackieTien97 commented on code in PR #14610:
URL: https://github.com/apache/iotdb/pull/14610#discussion_r1908002977


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AbstractQueryDeviceWithCache.java:
##########
@@ -85,6 +89,8 @@ public static List<ColumnHeader> getDeviceColumnHeaderList(
         .collect(Collectors.toList());
   }
 
+  public abstract Query getQuery();
+

Review Comment:
   ```suggestion
   ```
   no more be needed?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowDevice.java:
##########
@@ -57,6 +60,20 @@ public Node getLimit() {
     return limit;
   }
 
+  @Override
+  public Query getQuery() {
+    return QueryUtil.simpleQuery(
+        new Select(false, Collections.singletonList(new AllColumns())),
+        getTable(),
+        Optional.ofNullable(where),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.ofNullable(offset),
+        Optional.ofNullable(limit));
+  }
+

Review Comment:
   ```suggestion
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AbstractQueryDeviceWithCache.java:
##########
@@ -41,6 +41,8 @@ public abstract class AbstractQueryDeviceWithCache extends 
AbstractTraverseDevic
   // For query devices fully in cache
   protected List<ShowDevicesResult> results = new ArrayList<>();
 
+  protected Query query;
+

Review Comment:
   no more be needed?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/CountDevice.java:
##########
@@ -39,6 +41,27 @@ public CountDevice(
     super(location, table, rawExpression);
   }
 
+  @Override
+  public Query getQuery() {
+    return QueryUtil.simpleQuery(
+        new Select(
+            false,
+            Collections.singletonList(
+                new SingleColumn(
+                    new FunctionCall(
+                        QualifiedName.of(Collections.singletonList(new 
Identifier("count"))),
+                        Collections.emptyList()),
+                    new Identifier("count(devices)")))),
+        getTable(),
+        Optional.ofNullable(where),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty(),
+        Optional.empty());
+  }
+

Review Comment:
   ```suggestion
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AbstractQueryDeviceWithCache.java:
##########
@@ -41,6 +41,8 @@ public abstract class AbstractQueryDeviceWithCache extends 
AbstractTraverseDevic
   // For query devices fully in cache
   protected List<ShowDevicesResult> results = new ArrayList<>();
 
+  protected Query query;
+

Review Comment:
   ```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]

Reply via email to