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/03/02 14:46:50 UTC

[GitHub] [iotdb] SteveYurongSu commented on a change in pull request #4535: [IOTDB-1807] Compatibility of Apache IoTDB with InfluxDB - Parse InfluxQL

SteveYurongSu commented on a change in pull request #4535:
URL: https://github.com/apache/iotdb/pull/4535#discussion_r817760702



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/constant/SQLConstant.java
##########
@@ -30,7 +30,7 @@
 @SuppressWarnings("unused") // some fields are for future features
 public class SQLConstant {
 
-  private SQLConstant() {
+  public SQLConstant() {
     // forbidding instantiation

Review comment:
       throw exception here

##########
File path: server/src/main/java/org/apache/iotdb/db/protocol/influxdb/constant/InfluxSQLConstant.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.protocol.influxdb.constant;
+
+import org.apache.iotdb.db.qp.constant.SQLConstant;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/** this class contains several constants used in SQL. */
+public class InfluxSQLConstant extends SQLConstant {
+
+  public static final String MAX = "max";
+  public static final String MIN = "min";
+  public static final String FIRST = "first";
+  public static final String MEAN = "mean";
+  public static final String MEDIAN = "median";
+  public static final String MODE = "mode";
+  public static final String SPREAD = "spread";
+  public static final String STDDEV = "stddev";
+  private static final Set<String> NATIVE_FUNCTION_NAMES =
+      new HashSet<>(
+          Arrays.asList(MIN, MAX, FIRST, LAST, MEAN, COUNT, MEDIAN, MODE, SPREAD, STDDEV, SUM));
+  private static final Set<String> NATIVE_SELECTOR_FUNCTION_NAMES =
+      new HashSet<>(Arrays.asList(MIN, MAX, FIRST, LAST));
+
+  public InfluxSQLConstant() {
+    // forbidding instantiation

Review comment:
       throw exception here




-- 
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