From b6dedaf18ebb3f8bb0355db894b8fe1a03bc4eb8 Mon Sep 17 00:00:00 2001 From: feiniaofeiafei Date: Wed, 25 Dec 2024 14:24:56 +0800 Subject: [PATCH] remove space --- .../trees/expressions/functions/scalar/DateFormat.java | 9 ++++----- .../partition_prune/always_mono_func.groovy | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java index 972c0c8aec709f7..997464cf81a5ac6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java @@ -54,9 +54,9 @@ public class DateFormat extends ScalarFunction FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateType.INSTANCE, VarcharType.SYSTEM_DEFAULT) ); - private static final Set monoFormat = ImmutableSet.of("yyyyMMdd", "yyyy-MM-dd", "yyyy-MM-ddHH:mm:ss", - "%Y", "%Y-%m", "%Y-%m-%d", "%Y-%m-%d%H", "%Y-%m-%d%H:%i", "%Y-%m-%d%H:%i:%s", "%Y-%m-%d%H:%i:%S", - "%Y-%m-%d%T", "%Y%m%d", "%Y%m"); + private static final Set monoFormat = ImmutableSet.of("yyyyMMdd", "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", + "%Y", "%Y-%m", "%Y-%m-%d", "%Y-%m-%d %H", "%Y-%m-%d %H:%i", "%Y-%m-%d %H:%i:%s", "%Y-%m-%d %H:%i:%S", + "%Y-%m-%d %T", "%Y%m%d", "%Y%m"); /** * constructor with 2 arguments. @@ -90,8 +90,7 @@ public boolean isMonotonic(Literal lower, Literal upper) { if (!(format instanceof VarcharLiteral)) { return false; } - VarcharLiteral varcharLiteral = (VarcharLiteral) format; - String str = varcharLiteral.getValue().replace(" ", ""); + String str = ((VarcharLiteral) format).getValue(); return monoFormat.contains(str); } diff --git a/regression-test/suites/nereids_rules_p0/partition_prune/always_mono_func.groovy b/regression-test/suites/nereids_rules_p0/partition_prune/always_mono_func.groovy index 44eb0b873bbfb4e..1936dd85accc431 100644 --- a/regression-test/suites/nereids_rules_p0/partition_prune/always_mono_func.groovy +++ b/regression-test/suites/nereids_rules_p0/partition_prune/always_mono_func.groovy @@ -107,7 +107,7 @@ suite("always_mono_func") { } explain { sql """select * from always_mono_func where date_format(dt, "%Y %m") > "2019 01" """ - contains("partitions=2/5 (p4,p5)") + contains("partitions=5/5 (p1,p2,p3,p4,p5)") } explain {