You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 258656b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/AccumulatorFactory.java
Copy file name to clipboardExpand all lines: iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1249,7 +1249,26 @@ public static Type getFunctionType(String functionName, List<? extends Type> arg
1249
1249
functionName, weightType.getDisplayName()));
1250
1250
}
1251
1251
}
1252
+
break;
1253
+
caseSqlConstant.PERCENTILE:
1254
+
if (argumentTypes.size() != 2) {
1255
+
thrownewSemanticException(
1256
+
String.format(
1257
+
"Aggregation functions [%s] should only have two arguments", functionName));
1258
+
}
1252
1259
1260
+
if (!isNumericType(argumentTypes.get(0))) {
1261
+
thrownewSemanticException(
1262
+
String.format(
1263
+
"Aggregation functions [%s] should have value column as numeric type [INT32, INT64, FLOAT, DOUBLE, TIMESTAMP]",
1264
+
functionName));
1265
+
}
1266
+
if (!isDecimalType(argumentTypes.get(1))) {
1267
+
thrownewSemanticException(
1268
+
String.format(
1269
+
"Aggregation functions [%s] should have percentage as decimal type",
1270
+
functionName));
1271
+
}
1253
1272
break;
1254
1273
caseSqlConstant.COUNT:
1255
1274
break;
@@ -1275,6 +1294,7 @@ public static Type getFunctionType(String functionName, List<? extends Type> arg
Copy file name to clipboardExpand all lines: iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
Copy file name to clipboardExpand all lines: iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/relational/TableBuiltinAggregationFunction.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,8 @@ public enum TableBuiltinAggregationFunction {
59
59
VAR_SAMP("var_samp"),
60
60
APPROX_COUNT_DISTINCT("approx_count_distinct"),
61
61
APPROX_MOST_FREQUENT("approx_most_frequent"),
62
-
APPROX_PERCENTILE("approx_percentile");
62
+
APPROX_PERCENTILE("approx_percentile"),
63
+
PERCENTILE("percentile");
63
64
64
65
privatefinalStringfunctionName;
65
66
@@ -106,6 +107,7 @@ public static Type getIntermediateType(String name, List<Type> originalArgumentT
0 commit comments