Skip to content

Commit

Permalink
[fix](nereids)change lag/lead function signature (#40060)
Browse files Browse the repository at this point in the history
remove CharType from the signature
  • Loading branch information
starocean999 authored Aug 30, 2024
1 parent e78c38f commit 20af746
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.apache.doris.nereids.types.BigIntType;
import org.apache.doris.nereids.types.BooleanType;
import org.apache.doris.nereids.types.CharType;
import org.apache.doris.nereids.types.DataType;
import org.apache.doris.nereids.types.DateTimeType;
import org.apache.doris.nereids.types.DateTimeV2Type;
Expand Down Expand Up @@ -64,7 +63,6 @@ public interface RequireTrivialTypes {
DateTimeV2Type.SYSTEM_DEFAULT,
TimeType.INSTANCE,
TimeV2Type.INSTANCE,
CharType.SYSTEM_DEFAULT,
VarcharType.SYSTEM_DEFAULT,
StringType.INSTANCE
);
Expand Down
35 changes: 35 additions & 0 deletions regression-test/suites/nereids_syntax_p0/lag_lead_signature.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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.

suite("lag_lead_signature") {
sql "SET enable_nereids_planner=true"
sql "SET enable_fallback_to_original_planner=false"
sql """drop table if exists lag_lead_signature_t"""
sql """ CREATE TABLE lag_lead_signature_t (
`k` VARCHAR(200) NULL
) ENGINE=OLAP
DUPLICATE KEY(`k`)
DISTRIBUTED BY HASH(`k`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);"""

sql "insert into lag_lead_signature_t values ('44'), ('28');"

sql "select lag(k, 1, 0) over(), lead(k, 1, 0) over() from lag_lead_signature_t;"

}

0 comments on commit 20af746

Please sign in to comment.