• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / iotdb / #9919

25 Aug 2023 07:08AM UTC coverage: 47.802% (+0.007%) from 47.795%
#9919

push

travis_ci

web-flow
Remove some useless configs (#10950)

80023 of 167404 relevant lines covered (47.8%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/constant/SqlConstant.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19

20
package org.apache.iotdb.db.utils.constant;
21

22
import org.apache.iotdb.commons.path.PartialPath;
23

24
/** this class contains several constants used in SQL. */
25
public class SqlConstant {
26

27
  protected SqlConstant() {
×
28
    // forbidding instantiation
29
  }
×
30

31
  private static final String[] SINGLE_ROOT_ARRAY = {"root", "**"};
×
32
  private static final String[] SINGLE_TIME_ARRAY = {"time"};
×
33
  public static final PartialPath TIME_PATH = new PartialPath(SINGLE_TIME_ARRAY);
×
34
  public static final String RESERVED_TIME = "time";
35
  public static final String NOW_FUNC = "now()";
36

37
  public static final String ROOT = "root";
38
  public static final String QUOTE = "'";
39
  public static final String DQUOTE = "\"";
40
  public static final String BOOLEAN_TRUE = "true";
41
  public static final String BOOLEAN_FALSE = "false";
42
  public static final String BOOLEAN_TRUE_NUM = "1";
43
  public static final String BOOLEAN_FALSE_NUM = "0";
44

45
  // names of aggregations
46
  public static final String MIN_TIME = "min_time";
47
  public static final String MAX_TIME = "max_time";
48
  public static final String MAX_VALUE = "max_value";
49
  public static final String MIN_VALUE = "min_value";
50
  public static final String EXTREME = "extreme";
51
  public static final String FIRST_VALUE = "first_value";
52
  public static final String LAST_VALUE = "last_value";
53
  public static final String COUNT = "count";
54
  public static final String AVG = "avg";
55
  public static final String SUM = "sum";
56
  public static final String COUNT_IF = "count_if";
57
  public static final String TIME_DURATION = "time_duration";
58
  public static final String MODE = "mode";
59

60
  public static final String COUNT_TIME = "count_time";
61
  public static final String COUNT_TIME_HEADER = "count_time(*)";
62

63
  // names of scalar functions
64
  public static final String DIFF = "diff";
65

66
  public static final String LAST = "last";
67

68
  public static final String CAST_FUNCTION = "CAST";
69
  public static final String CAST_TYPE = "type";
70
  public static final String ROUND_FUNCTION = "ROUND";
71
  public static final String ROUND_PLACES = "PLACES";
72
  public static final String REPLACE_FUNCTION = "REPLACE";
73
  public static final String REPLACE_FROM = "FROM";
74
  public static final String REPLACE_TO = "TO";
75

76
  public static final String SUBSTRING_FUNCTION = "SUBSTRING";
77
  public static final String SUBSTRING_START = "startPosition";
78
  public static final String SUBSTRING_LENGTH = "length";
79

80
  public static final String SUBSTRING_FROM = "FROM";
81
  public static final String SUBSTRING_IS_STANDARD = "isStandard";
82
  public static final String SUBSTRING_FOR = "FOR";
83

84
  public static String[] getSingleRootArray() {
85
    return SINGLE_ROOT_ARRAY;
×
86
  }
87

88
  public static boolean isReservedPath(PartialPath pathStr) {
89
    return pathStr.equals(TIME_PATH);
×
90
  }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc