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


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/StatementMemorySourceVisitor.java:
##########
@@ -259,4 +260,19 @@ public StatementMemorySource visitShowPathsUsingTemplate(
     return new StatementMemorySource(
         tsBlockBuilder.build(), context.getAnalysis().getRespDatasetHeader());
   }
+
+  public StatementMemorySource visitShowCurrentTimestamp(
+      ShowCurrentTimestampStatement showCurrentTimestampStatement,
+      StatementMemorySourceContext context) {
+    List<TSDataType> outputDataTypes =
+        ColumnHeaderConstant.showCurrentTimestampColumnHeaders.stream()
+            .map(ColumnHeader::getColumnType)
+            .collect(Collectors.toList());
+    TsBlockBuilder tsBlockBuilder = new TsBlockBuilder(outputDataTypes);
+    tsBlockBuilder.getTimeColumnBuilder().writeLong(0L);
+    tsBlockBuilder.getColumnBuilder(0).writeLong(System.currentTimeMillis());

Review Comment:
   It's a long value, how to resolve this long value depends on the user. We 
can default return `ms`, in stardand sql, there will be a parameter called 
`precision` in current_timestamp function to decide whether to return `ms`, 
`us` or `ns`, so I think it's ok to defaultly return `ms` here and this 
function call's time precision should have nothing to do with our 
`timestamp_precision` configuration.



-- 
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-unsubscr...@iotdb.apache.org

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

Reply via email to