You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/02/17 15:37:52 UTC

[GitHub] [iotdb] RYH61 opened a new pull request #5081: show now()

RYH61 opened a new pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081


   ## Description
   
   
   ### Content1 ...
   
   ### Content2 ...
   
   ### Content3 ...
   
   <!--
   In each section, please describe design decisions made, including:
    - Choice of algorithms
    - Behavioral aspects. What configuration values are acceptable? How are corner cases and error 
       conditions handled, such as when there are insufficient resources?
    - Class organization and design (how the logic is split between classes, inheritance, composition, 
       design patterns)
    - Method organization and design (how the logic is split between methods, parameters and return types)
    - Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
   -->
   
   
   <!-- It's good to describe an alternative design (or mention an alternative name) for every design 
   (or naming) decision point and compare the alternatives with the designs that you've implemented 
   (or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
   
   <!-- If there was a discussion of the design of the feature implemented in this PR elsewhere 
   (e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list), 
   link to that discussion from this PR description and explain what have changed in your final design 
   compared to your original proposal or the consensus version in the end of the discussion. 
   If something hasn't changed since the original discussion, you can omit a detailed discussion of 
   those aspects of the design here, perhaps apart from brief mentioning for the sake of readability 
   of this PR description. -->
   
   <!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
   
   <hr>
   
   This PR has:
   - [ ] been self-reviewed.
       - [ ] concurrent read
       - [ ] concurrent write
       - [ ] concurrent read and write 
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. 
   - [ ] added or updated version, __license__, or notice information
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious 
     for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold 
     for code coverage.
   - [ ] added integration tests.
   - [ ] been tested in a test IoTDB cluster.
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items 
   apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items 
   from the checklist above are strictly necessary, but it would be very helpful if you at least 
   self-review the PR. -->
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) in this PR
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
HTHou edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1056402329


   > > 
   > 
   > From a coding point of view, it is very similar to aggregation. From a functional point of view, it is one of my commands, so maintenance in different regions is also possible.
   
   How about split it into two functions? One is `select now()` just like an aggregation, another is `show node info` as a maintenance command...


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
mychaow commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043842108


   please add cluster tests.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46648518/badge)](https://coveralls.io/builds/46648518)
   
   Coverage increased (+0.01%) to 67.794% when pulling **c2c2de6ca171c5918f4fa467bd67870d8a35725a on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809701996



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,11 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW NOW LR_BRACKET RR_BRACKET
+    ;

Review comment:
       Should we support `select now()` statement in this PR, which is the syntax of MySQL and PostgreSQL?




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] RYH61 commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
RYH61 commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809884435



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,11 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW NOW LR_BRACKET RR_BRACKET
+    ;

Review comment:
       MySQL's select now() only displays time. Now () is its function. Iotdb also has a function of now(). So would it be better to change to show now?




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809588759



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -64,15 +65,10 @@
 import org.apache.iotdb.db.qp.physical.crud.InsertRowsOfOneDevicePlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowsPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateMultiTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46676608/badge)](https://coveralls.io/builds/46676608)
   
   Coverage increased (+0.02%) to 67.803% when pulling **1e7828ea15162498ea0eb6528106d46078f62db0 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809590744



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java
##########
@@ -30,48 +30,7 @@
 import org.apache.iotdb.db.qp.physical.crud.InsertRowsPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
 import org.apache.iotdb.db.qp.physical.crud.SelectIntoPlan;
-import org.apache.iotdb.db.qp.physical.sys.ActivateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AlterTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.AppendTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
-import org.apache.iotdb.db.qp.physical.sys.AutoCreateDeviceMNodePlan;
-import org.apache.iotdb.db.qp.physical.sys.ChangeAliasPlan;
-import org.apache.iotdb.db.qp.physical.sys.ChangeTagOffsetPlan;
-import org.apache.iotdb.db.qp.physical.sys.ClearCachePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateIndexPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateMultiTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateSnapshotPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.DataAuthPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropIndexPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.FlushPlan;
-import org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan;
-import org.apache.iotdb.db.qp.physical.sys.LogPlan;
-import org.apache.iotdb.db.qp.physical.sys.MNodePlan;
-import org.apache.iotdb.db.qp.physical.sys.MeasurementMNodePlan;
-import org.apache.iotdb.db.qp.physical.sys.MergePlan;
-import org.apache.iotdb.db.qp.physical.sys.PruneTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetSystemModePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.StartTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.StopTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.StorageGroupMNodePlan;
-import org.apache.iotdb.db.qp.physical.sys.UnsetTemplatePlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46650911/badge)](https://coveralls.io/builds/46650911)
   
   Coverage increased (+0.008%) to 67.79% when pulling **529a308f63f98dea6f1751026dd2159cb4e7f8e3 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] neuyilan commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
neuyilan commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809785166



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/utils/ShowNowUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.iotdb.db.qp.utils;
+
+import org.apache.iotdb.db.query.dataset.ShowNowResult;
+
+import com.sun.management.OperatingSystemMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import oshi.SystemInfo;
+import oshi.hardware.CentralProcessor;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.LinkedList;
+import java.util.List;
+
+public class ShowNowUtils {
+  private static final Logger logger = LoggerFactory.getLogger(ShowNowUtils.class);
+
+  private String ipAddress;
+  private String systemTime;
+  private String cpuLoad;
+  private String totalMemorySize;
+  private String freeMemorySize;
+
+  public List<ShowNowResult> getShowNowResults() {
+    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");

Review comment:
       It's better that the time format can be transferred from the SQL.

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/utils/ShowNowUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.iotdb.db.qp.utils;
+
+import org.apache.iotdb.db.query.dataset.ShowNowResult;
+
+import com.sun.management.OperatingSystemMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import oshi.SystemInfo;
+import oshi.hardware.CentralProcessor;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.LinkedList;
+import java.util.List;
+
+public class ShowNowUtils {
+  private static final Logger logger = LoggerFactory.getLogger(ShowNowUtils.class);
+
+  private String ipAddress;
+  private String systemTime;
+  private String cpuLoad;
+  private String totalMemorySize;
+  private String freeMemorySize;
+
+  public List<ShowNowResult> getShowNowResults() {
+    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
+    SystemInfo systemInfo = new SystemInfo();
+    try {
+      ipAddress = InetAddress.getLocalHost().getHostAddress();
+    } catch (Exception e) {
+      e.printStackTrace();
+    }

Review comment:
       Why just use the `iotdb-engine.properties` `rpc_address` as the default ip  address?

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/utils/ShowNowUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.iotdb.db.qp.utils;
+
+import org.apache.iotdb.db.query.dataset.ShowNowResult;
+
+import com.sun.management.OperatingSystemMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import oshi.SystemInfo;
+import oshi.hardware.CentralProcessor;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.LinkedList;
+import java.util.List;
+
+public class ShowNowUtils {
+  private static final Logger logger = LoggerFactory.getLogger(ShowNowUtils.class);
+
+  private String ipAddress;
+  private String systemTime;
+  private String cpuLoad;
+  private String totalMemorySize;
+  private String freeMemorySize;
+
+  public List<ShowNowResult> getShowNowResults() {
+    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
+    SystemInfo systemInfo = new SystemInfo();
+    try {
+      ipAddress = InetAddress.getLocalHost().getHostAddress();
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+    try {
+      OperatingSystemMXBean osmxb =
+          (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+      CentralProcessor processor = systemInfo.getHardware().getProcessor();
+      totalMemorySize =
+          new DecimalFormat("#.##")
+                  .format(osmxb.getTotalPhysicalMemorySize() / 1024.0 / 1024 / 1024)
+              + "G";
+      freeMemorySize =
+          new DecimalFormat("#.##").format(osmxb.getFreePhysicalMemorySize() / 1024.0 / 1024 / 1024)
+              + "G";
+      systemTime = df.format(System.currentTimeMillis());
+      cpuLoad = new DecimalFormat("#.##").format(processor.getSystemCpuLoad() * 100) + "%";
+    } catch (Exception e) {
+      e.printStackTrace();

Review comment:
       It's better to log the exception.

##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,11 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW NOW LR_BRACKET RR_BRACKET
+    ;

Review comment:
       I think it would be better if the syntax is the same with MySQL or PostgreSQL.

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/query/shownow/ClusterShowNowQueryExecutor.java
##########
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.iotdb.cluster.query.shownow;
+
+import org.apache.iotdb.cluster.ClusterIoTDB;
+import org.apache.iotdb.cluster.client.async.AsyncDataClient;
+import org.apache.iotdb.cluster.client.sync.SyncClientAdaptor;
+import org.apache.iotdb.cluster.client.sync.SyncDataClient;
+import org.apache.iotdb.cluster.config.ClusterConstant;
+import org.apache.iotdb.cluster.config.ClusterDescriptor;
+import org.apache.iotdb.cluster.rpc.thrift.Node;
+import org.apache.iotdb.cluster.server.member.MetaGroupMember;
+import org.apache.iotdb.db.exception.metadata.MetadataException;
+import org.apache.iotdb.db.qp.physical.sys.ShowNowPlan;
+import org.apache.iotdb.db.qp.utils.ShowNowUtils;
+import org.apache.iotdb.db.query.context.QueryContext;
+import org.apache.iotdb.db.query.dataset.ShowNowDataSet;
+import org.apache.iotdb.db.query.dataset.ShowNowResult;
+import org.apache.iotdb.db.query.executor.ShowNowQueryExecutor;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.*;
+
+import static org.apache.iotdb.cluster.query.ClusterPlanExecutor.*;
+
+public class ClusterShowNowQueryExecutor extends ShowNowQueryExecutor {
+  private static final Logger logger = LoggerFactory.getLogger(ClusterShowNowQueryExecutor.class);
+  private MetaGroupMember metaGroupMember;
+
+  private static ExecutorService showNowQueryPool =
+      Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
+
+  public ClusterShowNowQueryExecutor(ShowNowPlan showNowPlan, MetaGroupMember metaGroupMember) {
+    super();
+    this.metaGroupMember = metaGroupMember;
+  }
+
+  @Override
+  public QueryDataSet execute(QueryContext context, ShowNowPlan showNowPlan)
+      throws MetadataException {
+    ConcurrentSkipListSet<ShowNowResult> resultSet = new ConcurrentSkipListSet<>();
+
+    ExecutorService pool =
+        new ThreadPoolExecutor(
+            THREAD_POOL_SIZE, THREAD_POOL_SIZE, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
+    List<Node> nodeList = metaGroupMember.getPartitionTable().getAllNodes();
+    List<Future<Void>> futureList = new ArrayList<>();
+    for (Node node : nodeList) {
+      futureList.add(
+          pool.submit(
+              () -> {
+                try {
+                  showNow(node, showNowPlan, resultSet, context);
+                } catch (Exception e) {
+                  logger.error("Cannot get show now result of {} from {}", showNowPlan, node);
+                }
+                return null;
+              }));
+    }
+
+    waitForThreadPool(futureList, pool, "showNow()");
+    List<ShowNowResult> showNowResults = applyShowNow(resultSet);
+    return new ShowNowDataSet(showNowResults, context, showNowPlan);
+  }
+
+  private void showNow(
+      Node node, ShowNowPlan showNowPlan, Set<ShowNowResult> resultSet, QueryContext context) {
+    if (node.equals(metaGroupMember.getThisNode())) {
+      showLocalNow(node, showNowPlan, resultSet, context);
+    } else {
+      showRemoteNow(node, showNowPlan, resultSet);
+    }
+  }
+
+  private void showLocalNow(
+      Node node, ShowNowPlan plan, Set<ShowNowResult> resultSet, QueryContext context) {
+    try {
+      List<ShowNowResult> localResult = null;
+      try {
+        localResult = new ShowNowUtils().getShowNowResults();
+      } catch (Exception e) {
+        e.printStackTrace();
+        logger.error("ClusterShowNowQueryExecutor showLocalNow");

Review comment:
       delete the `e.printStackTrace();` and log the exception in the log. 
   The same as others.




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809603118



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -1450,6 +1446,115 @@ protected IMeasurementMNode getMeasurementMNode(IMNode deviceMNode, String measu
     return showDevicesResults;
   }
 
+  @Override
+  public List<ShowNowResult> showNow(ShowNowPlan plan, QueryContext context)

Review comment:
       do we need the method? I could not found the place you call it.




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46665476/badge)](https://coveralls.io/builds/46665476)
   
   Coverage remained the same at 67.782% when pulling **94a3a6ec45e2e349f35d003a1699a2350615c230 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809590125



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
##########
@@ -25,29 +25,8 @@
 import org.apache.iotdb.db.qp.physical.PhysicalPlan;
 import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
-import org.apache.iotdb.db.qp.physical.sys.AppendTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
-import org.apache.iotdb.db.qp.physical.sys.ClearCachePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateSnapshotPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.DataAuthPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.FlushPlan;
-import org.apache.iotdb.db.qp.physical.sys.KillQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809593332



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/logical/sys/ShowOperator.java
##########
@@ -24,11 +24,8 @@
 import org.apache.iotdb.db.qp.constant.SQLConstant;
 import org.apache.iotdb.db.qp.logical.Operator;
 import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowContinuousQueriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809617760



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,15 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW timeClause

Review comment:
       show timeclause???




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46669123/badge)](https://coveralls.io/builds/46669123)
   
   Coverage decreased (-0.007%) to 67.776% when pulling **bf2733727dff1ab9de4b8f6d075ba797a246840d on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46665440/badge)](https://coveralls.io/builds/46665440)
   
   Coverage decreased (-0.02%) to 67.763% when pulling **94a3a6ec45e2e349f35d003a1699a2350615c230 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46665487/badge)](https://coveralls.io/builds/46665487)
   
   Coverage increased (+0.004%) to 67.787% when pulling **94a3a6ec45e2e349f35d003a1699a2350615c230 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
mychaow commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1066265508


   
   
   
   
   > > > 
   > > 
   > > 
   > > From a coding point of view, it is very similar to aggregation. From a functional point of view, it is one of my commands, so maintenance in different regions is also possible.
   > 
   > How about split it into two functions? One is `select now()` just like an aggregation, another is `show node info` as a maintenance command...
   
   ok, split it to two functions.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls commented on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46646555/badge)](https://coveralls.io/builds/46646555)
   
   Coverage decreased (-0.01%) to 67.772% when pulling **09ef9e1fc919baecc15fad6886bf61c26afed514 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809600821



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/utils/ShowNowUtils.java
##########
@@ -0,0 +1,57 @@
+package org.apache.iotdb.db.qp.utils;

Review comment:
       add license header, same as all new file




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809589835



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterQueryRouter.java
##########
@@ -33,14 +34,11 @@
 import org.apache.iotdb.db.qp.physical.crud.LastQueryPlan;
 import org.apache.iotdb.db.qp.physical.crud.RawDataQueryPlan;
 import org.apache.iotdb.db.qp.physical.crud.UDTFPlan;
+import org.apache.iotdb.db.qp.physical.sys.ShowNowPlan;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.dataset.groupby.GroupByWithValueFilterDataSet;
 import org.apache.iotdb.db.query.dataset.groupby.GroupByWithoutValueFilterDataSet;
-import org.apache.iotdb.db.query.executor.AggregationExecutor;
-import org.apache.iotdb.db.query.executor.FillQueryExecutor;
-import org.apache.iotdb.db.query.executor.LastQueryExecutor;
-import org.apache.iotdb.db.query.executor.QueryRouter;
-import org.apache.iotdb.db.query.executor.RawDataQueryExecutor;
+import org.apache.iotdb.db.query.executor.*;

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809706487



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -45,7 +44,7 @@ ddlStatement
     | showFunctions | showTriggers | showContinuousQueries | showTTL | showAllTTL
     | showSchemaTemplates | showNodesInSchemaTemplate
     | showPathsUsingSchemaTemplate | showPathsSetSchemaTemplate
-    | countStorageGroup | countDevices | countTimeseries | countNodes
+    | countStorageGroup | countDevices | countTimeseries | countNodes | showNow

Review comment:
       I think it's a dml statement, because it's a query, 




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46722251/badge)](https://coveralls.io/builds/46722251)
   
   Coverage increased (+0.005%) to 67.787% when pulling **e1ba1e7a72c9697c71eefd1b72b8ad62069aaf7f on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46677298/badge)](https://coveralls.io/builds/46677298)
   
   Coverage increased (+0.01%) to 67.796% when pulling **5a28ee345b641f1ee787cecc43916190c7d79286 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
mychaow commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1050504150


   > 
   
   From a coding point of view, it is very similar to aggregation. From a functional point of view, it is one of my commands, so maintenance in different regions is also possible.


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] neuyilan commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
neuyilan commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809785166



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/utils/ShowNowUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.iotdb.db.qp.utils;
+
+import org.apache.iotdb.db.query.dataset.ShowNowResult;
+
+import com.sun.management.OperatingSystemMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import oshi.SystemInfo;
+import oshi.hardware.CentralProcessor;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.LinkedList;
+import java.util.List;
+
+public class ShowNowUtils {
+  private static final Logger logger = LoggerFactory.getLogger(ShowNowUtils.class);
+
+  private String ipAddress;
+  private String systemTime;
+  private String cpuLoad;
+  private String totalMemorySize;
+  private String freeMemorySize;
+
+  public List<ShowNowResult> getShowNowResults() {
+    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");

Review comment:
       It's better that the time format can be transferred from the SQL, but I think it is ok in the next version




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312






-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
HTHou commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1056402329


   > > 
   > 
   > From a coding point of view, it is very similar to aggregation. From a functional point of view, it is one of my commands, so maintenance in different regions is also possible.
   
   How about split it into two function? One is `select now()` just like an aggregation, another is `show node info` as a maintenance command...


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809617760



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,15 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW timeClause

Review comment:
       show timeclause??? I think show now is ok, do not need to use timeClause




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46666562/badge)](https://coveralls.io/builds/46666562)
   
   Coverage remained the same at 67.782% when pulling **22e97b478393a7cd2f4696285351dbba9fce1126 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46678600/badge)](https://coveralls.io/builds/46678600)
   
   Coverage increased (+0.01%) to 67.793% when pulling **5a28ee345b641f1ee787cecc43916190c7d79286 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809590444



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -60,28 +60,11 @@
 import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
-import org.apache.iotdb.db.qp.physical.sys.ActivateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AppendTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AutoCreateDeviceMNodePlan;
-import org.apache.iotdb.db.qp.physical.sys.ChangeAliasPlan;
-import org.apache.iotdb.db.qp.physical.sys.ChangeTagOffsetPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.PruneTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.UnsetTemplatePlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809590285



##########
File path: integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryDemoIT.java
##########
@@ -23,18 +23,14 @@
 import org.apache.iotdb.itbase.category.LocalStandaloneTest;
 import org.apache.iotdb.itbase.category.RemoteTest;
 
+import org.apache.iotdb.jdbc.Config;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
+import java.sql.*;

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1047024827


   It seems that now() can be a special aggregation function.
   
   How do you think? @neuyilan @mychaow @HTHou 


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46651417/badge)](https://coveralls.io/builds/46651417)
   
   Coverage decreased (-0.02%) to 67.763% when pulling **529a308f63f98dea6f1751026dd2159cb4e7f8e3 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809589105



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -1450,6 +1446,115 @@ protected IMeasurementMNode getMeasurementMNode(IMNode deviceMNode, String measu
     return showDevicesResults;
   }
 
+  @Override
+  public List<ShowNowResult> showNow(ShowNowPlan plan, QueryContext context)
+      throws MetadataException {
+    ConcurrentSkipListSet<ShowNowResult> resultSet = new ConcurrentSkipListSet<>();
+    ExecutorService pool =
+        new ThreadPoolExecutor(
+            THREAD_POOL_SIZE, THREAD_POOL_SIZE, 0, TimeUnit.SECONDS, new LinkedBlockingDeque<>());
+    List<PartitionGroup> globalGroups;
+    metaGroupMember.getPartitionTable();
+    try {
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+      PartitionGroup partitionGroup =
+          metaGroupMember.getPartitionTable().partitionByPathTime(plan.getPath(), 0);
+      PartitionTable partitionTable = metaGroupMember.getPartitionTable();
+      List<Node> nodeList = partitionTable.getAllNodes();
+      globalGroups.add(partitionGroup);
+    } catch (MetadataException e) {
+      // if the path location is not find, obtain the path location from all groups.
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+    }
+    List<Node> nodeList = metaGroupMember.getPartitionTable().getAllNodes();
+    List<Future<Void>> futureList = new ArrayList<>();
+    for (PartitionGroup group : globalGroups) {
+      futureList.add(
+          pool.submit(
+              () -> {
+                try {
+                  showNow(group, plan, resultSet, context);
+                } catch (Exception e) {
+                  logger.error(
+                      "\"****************Cannot get show now result of {} from {}\", plan, node");

Review comment:
       no need to print so many star.

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -1450,6 +1446,115 @@ protected IMeasurementMNode getMeasurementMNode(IMNode deviceMNode, String measu
     return showDevicesResults;
   }
 
+  @Override
+  public List<ShowNowResult> showNow(ShowNowPlan plan, QueryContext context)
+      throws MetadataException {
+    ConcurrentSkipListSet<ShowNowResult> resultSet = new ConcurrentSkipListSet<>();
+    ExecutorService pool =
+        new ThreadPoolExecutor(
+            THREAD_POOL_SIZE, THREAD_POOL_SIZE, 0, TimeUnit.SECONDS, new LinkedBlockingDeque<>());
+    List<PartitionGroup> globalGroups;
+    metaGroupMember.getPartitionTable();
+    try {
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+      PartitionGroup partitionGroup =
+          metaGroupMember.getPartitionTable().partitionByPathTime(plan.getPath(), 0);
+      PartitionTable partitionTable = metaGroupMember.getPartitionTable();
+      List<Node> nodeList = partitionTable.getAllNodes();
+      globalGroups.add(partitionGroup);
+    } catch (MetadataException e) {
+      // if the path location is not find, obtain the path location from all groups.
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+    }
+    List<Node> nodeList = metaGroupMember.getPartitionTable().getAllNodes();
+    List<Future<Void>> futureList = new ArrayList<>();
+    for (PartitionGroup group : globalGroups) {
+      futureList.add(
+          pool.submit(
+              () -> {
+                try {
+                  showNow(group, plan, resultSet, context);
+                } catch (Exception e) {
+                  logger.error(
+                      "\"****************Cannot get show now result of {} from {}\", plan, node");
+                }
+                return null;
+              }));
+    }
+    waitForThreadPool(futureList, pool, "showNow()");
+    List<ShowNowResult> showNowResults = applyShowNow(resultSet);
+    return showNowResults;
+  }
+
+  private void showNow(
+      PartitionGroup group, ShowNowPlan plan, Set<ShowNowResult> resultSet, QueryContext context)
+      throws CheckConsistencyException, MetadataException {
+    if (group.contains(metaGroupMember.getThisNode())) {
+      showLocalNow(group, plan, resultSet, context);
+    } else {
+      showRemoteNow(group, plan, resultSet, context);
+    }
+  }
+
+  private void showLocalNow(
+      PartitionGroup group, ShowNowPlan plan, Set<ShowNowResult> resultSet, QueryContext context)
+      throws CheckConsistencyException {
+    RaftNode header = group.getHeader();
+    DataGroupMember localDataMember = metaGroupMember.getLocalDataMember(header);
+    localDataMember.syncLeaderWithConsistencyCheck(false);
+    try {
+      List<ShowNowResult> localResult = null;
+      try {
+        localResult = super.showNow(plan, context);
+      } catch (Exception e) {
+        e.printStackTrace();
+        logger.error("********CMManager showLocalNow");

Review comment:
       same as above

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
##########
@@ -1450,6 +1446,115 @@ protected IMeasurementMNode getMeasurementMNode(IMNode deviceMNode, String measu
     return showDevicesResults;
   }
 
+  @Override
+  public List<ShowNowResult> showNow(ShowNowPlan plan, QueryContext context)
+      throws MetadataException {
+    ConcurrentSkipListSet<ShowNowResult> resultSet = new ConcurrentSkipListSet<>();
+    ExecutorService pool =
+        new ThreadPoolExecutor(
+            THREAD_POOL_SIZE, THREAD_POOL_SIZE, 0, TimeUnit.SECONDS, new LinkedBlockingDeque<>());
+    List<PartitionGroup> globalGroups;
+    metaGroupMember.getPartitionTable();
+    try {
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+      PartitionGroup partitionGroup =
+          metaGroupMember.getPartitionTable().partitionByPathTime(plan.getPath(), 0);
+      PartitionTable partitionTable = metaGroupMember.getPartitionTable();
+      List<Node> nodeList = partitionTable.getAllNodes();
+      globalGroups.add(partitionGroup);
+    } catch (MetadataException e) {
+      // if the path location is not find, obtain the path location from all groups.
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+    }
+    List<Node> nodeList = metaGroupMember.getPartitionTable().getAllNodes();
+    List<Future<Void>> futureList = new ArrayList<>();
+    for (PartitionGroup group : globalGroups) {
+      futureList.add(
+          pool.submit(
+              () -> {
+                try {
+                  showNow(group, plan, resultSet, context);
+                } catch (Exception e) {
+                  logger.error(
+                      "\"****************Cannot get show now result of {} from {}\", plan, node");
+                }
+                return null;
+              }));
+    }
+    waitForThreadPool(futureList, pool, "showNow()");
+    List<ShowNowResult> showNowResults = applyShowNow(resultSet);
+    return showNowResults;
+  }
+
+  private void showNow(
+      PartitionGroup group, ShowNowPlan plan, Set<ShowNowResult> resultSet, QueryContext context)
+      throws CheckConsistencyException, MetadataException {
+    if (group.contains(metaGroupMember.getThisNode())) {
+      showLocalNow(group, plan, resultSet, context);
+    } else {
+      showRemoteNow(group, plan, resultSet, context);
+    }
+  }
+
+  private void showLocalNow(
+      PartitionGroup group, ShowNowPlan plan, Set<ShowNowResult> resultSet, QueryContext context)
+      throws CheckConsistencyException {
+    RaftNode header = group.getHeader();
+    DataGroupMember localDataMember = metaGroupMember.getLocalDataMember(header);
+    localDataMember.syncLeaderWithConsistencyCheck(false);
+    try {
+      List<ShowNowResult> localResult = null;
+      try {
+        localResult = super.showNow(plan, context);
+      } catch (Exception e) {
+        e.printStackTrace();
+        logger.error("********CMManager showLocalNow");
+      }
+      try {
+        if (localResult != null) {
+          resultSet.addAll(localResult);
+        }
+      } catch (Exception e) {
+        logger.error("******************** showLocalNow 1665");

Review comment:
       same as above




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809590561



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -79,60 +79,12 @@
 import org.apache.iotdb.db.qp.physical.crud.RawDataQueryPlan;
 import org.apache.iotdb.db.qp.physical.crud.UDAFPlan;
 import org.apache.iotdb.db.qp.physical.crud.UDTFPlan;
-import org.apache.iotdb.db.qp.physical.sys.ActivateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AlterTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.AppendTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
-import org.apache.iotdb.db.qp.physical.sys.CountPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateMultiTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.DataAuthPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.FlushPlan;
-import org.apache.iotdb.db.qp.physical.sys.KillQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan;
-import org.apache.iotdb.db.qp.physical.sys.OperateFilePlan;
-import org.apache.iotdb.db.qp.physical.sys.PruneTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetSystemModePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SettlePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowChildNodesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowChildPathsPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowFunctionsPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowLockInfoPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowNodesInTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPathsSetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPathsUsingTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.StartTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.StopTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.UnsetTemplatePlan;
+import org.apache.iotdb.db.qp.physical.sys.*;

Review comment:
       same as above

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -79,60 +79,12 @@
 import org.apache.iotdb.db.qp.physical.crud.RawDataQueryPlan;
 import org.apache.iotdb.db.qp.physical.crud.UDAFPlan;
 import org.apache.iotdb.db.qp.physical.crud.UDTFPlan;
-import org.apache.iotdb.db.qp.physical.sys.ActivateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AlterTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.AppendTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
-import org.apache.iotdb.db.qp.physical.sys.CountPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateMultiTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.DataAuthPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropContinuousQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropFunctionPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.DropTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.FlushPlan;
-import org.apache.iotdb.db.qp.physical.sys.KillQueryPlan;
-import org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan;
-import org.apache.iotdb.db.qp.physical.sys.OperateFilePlan;
-import org.apache.iotdb.db.qp.physical.sys.PruneTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetSystemModePlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.SettlePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowChildNodesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowChildPathsPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowFunctionsPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowLockInfoPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowNodesInTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPathsSetTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPathsUsingTemplatePlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowStorageGroupPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTTLPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.StartTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.StopTriggerPlan;
-import org.apache.iotdb.db.qp.physical.sys.UnsetTemplatePlan;
+import org.apache.iotdb.db.qp.physical.sys.*;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.control.FileReaderManager;
 import org.apache.iotdb.db.query.control.QueryResourceManager;
 import org.apache.iotdb.db.query.control.QueryTimeManager;
-import org.apache.iotdb.db.query.dataset.AlignByDeviceDataSet;
-import org.apache.iotdb.db.query.dataset.ListDataSet;
-import org.apache.iotdb.db.query.dataset.ShowContinuousQueriesResult;
-import org.apache.iotdb.db.query.dataset.ShowDevicesDataSet;
-import org.apache.iotdb.db.query.dataset.ShowTimeseriesDataSet;
-import org.apache.iotdb.db.query.dataset.SingleDataSet;
+import org.apache.iotdb.db.query.dataset.*;

Review comment:
       same




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] mychaow commented on a change in pull request #5081: show now()

Posted by GitBox <gi...@apache.org>.
mychaow commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809588596



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientAdaptor.java
##########
@@ -40,21 +40,13 @@
 import org.apache.iotdb.cluster.rpc.thrift.SingleSeriesQueryRequest;
 import org.apache.iotdb.cluster.rpc.thrift.StartUpStatus;
 import org.apache.iotdb.cluster.rpc.thrift.TNodeStatus;
-import org.apache.iotdb.cluster.server.handlers.caller.GenericHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetChildNodeNextLevelHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetChildNodeNextLevelPathHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetDevicesHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetNodesListHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetTimeseriesSchemaHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.JoinClusterHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullMeasurementSchemaHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullSnapshotHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullTimeseriesSchemaHandler;
+import org.apache.iotdb.cluster.server.handlers.caller.*;

Review comment:
       do not use *




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on a change in pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#discussion_r809699529



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -45,7 +44,7 @@ ddlStatement
     | showFunctions | showTriggers | showContinuousQueries | showTTL | showAllTTL
     | showSchemaTemplates | showNodesInSchemaTemplate
     | showPathsUsingSchemaTemplate | showPathsSetSchemaTemplate
-    | countStorageGroup | countDevices | countTimeseries | countNodes
+    | countStorageGroup | countDevices | countTimeseries | countNodes | showNow

Review comment:
       Hi, I think `show now() ` is not a kind of ddl statement but a dml. Move it to `dmlStatement` ?

##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
##########
@@ -285,6 +284,11 @@ showAllTTL
     : SHOW ALL TTL
     ;
 
+// Show NOW
+showNow
+    : SHOW NOW LR_BRACKET RR_BRACKET
+    ;

Review comment:
       Should we support `select now()` statement in this PR, which is that syntax of MySQL and PostgreSQL?




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46678247/badge)](https://coveralls.io/builds/46678247)
   
   Coverage decreased (-0.02%) to 67.759% when pulling **5a28ee345b641f1ee787cecc43916190c7d79286 on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
HTHou commented on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1046398957


   Hi, any user guide to show the function definition and usage?


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46718688/badge)](https://coveralls.io/builds/46718688)
   
   Coverage increased (+0.02%) to 67.803% when pulling **98a2c1c3b784ddf331aec7b6674b8e77c550425c on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #5081: [ISSUE-3857] Support show now() function

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #5081:
URL: https://github.com/apache/iotdb/pull/5081#issuecomment-1043174312


   
   [![Coverage Status](https://coveralls.io/builds/46717551/badge)](https://coveralls.io/builds/46717551)
   
   Coverage increased (+0.009%) to 67.791% when pulling **b9390da1604e3fa4124b0c575fa500888156bd4d on RYH61:fix_ryh** into **e95789cb190940c825ea7360f4a90857706fe4e6 on apache:master**.
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org