This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new ba75f3457cd [opt](Nereids) update first_value and last_value signature
(#25790)
ba75f3457cd is described below
commit ba75f3457cda1364d626d2eb104393e17e2f038a
Author: morrySnow <[email protected]>
AuthorDate: Wed Oct 25 13:49:27 2023 +0800
[opt](Nereids) update first_value and last_value signature (#25790)
---
.../functions/window/FirstOrLastValue.java | 18 ++++------
.../function/test_not_supported_agg_fn.groovy | 42 ----------------------
2 files changed, 6 insertions(+), 54 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/FirstOrLastValue.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/FirstOrLastValue.java
index 44bcf40ec36..0cbccad58de 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/FirstOrLastValue.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/FirstOrLastValue.java
@@ -19,28 +19,22 @@ package
org.apache.doris.nereids.trees.expressions.functions.window;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.IdenticalSignature;
+import
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
+import org.apache.doris.nereids.types.coercion.AnyDataType;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
import java.util.List;
/** parent class for first_value() and last_value() */
public abstract class FirstOrLastValue extends WindowFunction
- implements UnaryExpression, PropagateNullable, IdenticalSignature,
RequireTrivialTypes {
-
- static {
- List<FunctionSignature> signatures = Lists.newArrayList();
- trivialTypes.forEach(t ->
- signatures.add(FunctionSignature.ret(t).args(t))
- );
- SIGNATURES = ImmutableList.copyOf(signatures);
- }
+ implements UnaryExpression, PropagateNullable,
ExplicitlyCastableSignature {
- private static final List<FunctionSignature> SIGNATURES;
+ private static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
+
FunctionSignature.retArgType(0).args(AnyDataType.INSTANCE_WITHOUT_INDEX)
+ );
public FirstOrLastValue(String name, Expression child) {
super(name, child);
diff --git
a/regression-test/suites/tpch_sf0.1_p1/function/test_not_supported_agg_fn.groovy
b/regression-test/suites/tpch_sf0.1_p1/function/test_not_supported_agg_fn.groovy
deleted file mode 100644
index 5be66d7a6fe..00000000000
---
a/regression-test/suites/tpch_sf0.1_p1/function/test_not_supported_agg_fn.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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.
-
-// There once exists a bug that when passing a too long string
-// along with an empty one to find_in_set, BE
-
-suite("test_not_supported_agg_fn") {
-
- try {
- test {
- sql """
- SELECT ref_0.`PS_SUPPKEY` AS c0,
- ref_0.`PS_SUPPLYCOST` AS c1,
- last_value(cast(bitmap_empty() AS BITMAP)) OVER (PARTITION BY
ref_0.`PS_AVAILQTY`
- ORDER BY
ref_0.`PS_PARTKEY` DESC) AS c2,
- CASE
- WHEN FALSE THEN
ref_0.`PS_COMMENT`
- ELSE
ref_0.`PS_COMMENT`
- END AS c3
- FROM regression_test_tpch_sf0_1_p1.partsupp AS ref_0
- WHERE ref_0.`PS_PARTKEY` IS NULL
- ORDER BY ref_0.`PS_COMMENT`
- """
- exception "errCode = 2, detailMessage = No matching function with
signature: last_value(bitmap)"
- }
- } finally {
- }
-}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]