From feebe3e6fbe05a57d38535efbafca825bfc68475 Mon Sep 17 00:00:00 2001 From: amory Date: Thu, 28 Dec 2023 23:08:01 +0800 Subject: [PATCH] [FIX](literal) fix expression literal error #29157 --- .../doris/analysis/ExpressionFunctions.java | 4 +++- .../literal_view/lietral_largeint.out | 10 +++++++++ .../literal_view/lietral_largeint.groovy | 22 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 regression-test/data/query_p0/literal_view/lietral_largeint.out create mode 100644 regression-test/suites/query_p0/literal_view/lietral_largeint.groovy diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java index ea63a8ffab..0ba9122373 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java @@ -278,8 +278,10 @@ public enum ExpressionFunctions { LiteralExpr[] exprs; if (argType.isStringType()) { exprs = new StringLiteral[args.size()]; - } else if (argType.isFixedPointType()) { + } else if (argType.isIntegerType()) { exprs = new IntLiteral[args.size()]; + } else if (argType.isLargeIntType()) { + exprs = new LargeIntLiteral[args.size()]; } else if (argType.isDateType()) { exprs = new DateLiteral[args.size()]; } else if (argType.isDecimalV2() || argType.isDecimalV3()) { diff --git a/regression-test/data/query_p0/literal_view/lietral_largeint.out b/regression-test/data/query_p0/literal_view/lietral_largeint.out new file mode 100644 index 0000000000..438ff77153 --- /dev/null +++ b/regression-test/data/query_p0/literal_view/lietral_largeint.out @@ -0,0 +1,10 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +[1] + +-- !sql -- +[1, null] + +-- !sql -- +[1, null, 18446744073709551615] + diff --git a/regression-test/suites/query_p0/literal_view/lietral_largeint.groovy b/regression-test/suites/query_p0/literal_view/lietral_largeint.groovy new file mode 100644 index 0000000000..7ba7e048b8 --- /dev/null +++ b/regression-test/suites/query_p0/literal_view/lietral_largeint.groovy @@ -0,0 +1,22 @@ +// 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("literal_largeint") { + qt_sql "select array(cast(1 as LargeInt))" + qt_sql "select array(cast(1 as LargeInt), NULL)" + qt_sql "select array(cast(1 as LargeInt), NULL, cast(18446744073709551615 as LargeInt))" +}