diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionExprUtil.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionExprUtil.java index fe82f2dc1f6892..0f7e1f92347eac 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionExprUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionExprUtil.java @@ -159,7 +159,8 @@ public static Map getAddPartitionClauseFromPartition partitionName += getFormatPartitionValue(filterStr); if (partitionColumnType.isStringType()) { if (partitionName.length() > 50) { - partitionName = partitionName.substring(40) + Objects.hash(partitionName) + "_" + System.currentTimeMillis(); + partitionName = partitionName.substring(40) + Objects.hash(partitionName) + + "_" + System.currentTimeMillis(); } } } else { diff --git a/regression-test/data/partition_p0/auto_partition/test_auto_partition_behavior.out b/regression-test/data/partition_p0/auto_partition/test_auto_partition_behavior.out index 53cd65f5d8c721..ac0ac36cee2853 100644 --- a/regression-test/data/partition_p0/auto_partition/test_auto_partition_behavior.out +++ b/regression-test/data/partition_p0/auto_partition/test_auto_partition_behavior.out @@ -1,32 +1,33 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql1 -- - - - ! - ! -Xxx -xxX + 1 + 2 + ! 3 + ! 4 +Xxx 3 +xxX 3 -- !sql2 -- - - - ! - ! -Xxx -xxX + 1 + 2 + ! 3 + ! 4 +Xxx 3 +xxX 3 -- !sql3 -- - - ! - ! - - -- -- - --- -Xxx -xxX + 2 + ! 3 + ! 4 + - 3 +- 1 +- - 3 +-- 2 +Xxx 3 +xxX 3 -- !sql4 -- + 2 -- !sql5 -- 1 @@ -49,46 +50,46 @@ Xxx xxX -- !sql2 -- - - - - - ! - ! - ! - ! -Xxx -Xxx -xxX -xxX + 1 + 1 + 2 + 2 + ! 3 + ! 3 + ! 4 + ! 4 +Xxx 3 +Xxx 3 +xxX 3 +xxX 3 -- !sql3 -- - - - ! - ! - ! - ! - - -- -- - --- -Xxx -Xxx -xxX -xxX + 2 + 2 + ! 3 + ! 3 + ! 4 + ! 4 + - 3 +- 1 +- - 3 +-- 2 +Xxx 3 +Xxx 3 +xxX 3 +xxX 3 -- !sql4 -- - ! - ! - - -- -- - --- -Xxx -Xxx -xxX -xxX + ! 4 + ! 4 + - 3 +- 1 +- - 3 +-- 2 +Xxx 3 +Xxx 3 +xxX 3 +xxX 3 -- !sql1 -- 2009-12-12T00:00 2020-12-12T00:00 diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy index 6407f9afecabac..6875dd840c4e48 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy @@ -35,11 +35,11 @@ suite("test_auto_partition_behavior") { """ // special characters sql """ insert into unique_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """ - qt_sql1 """ select * from unique_table order by `str` """ + qt_sql1 """ select *,length(str) from unique_table order by `str` """ def result = sql "show partitions from unique_table" assertEquals(result.size(), 6) sql """ insert into unique_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """ - qt_sql2 """ select * from unique_table order by `str` """ + qt_sql2 """ select *,length(str) from unique_table order by `str` """ result = sql "show partitions from unique_table" assertEquals(result.size(), 6) sql """ insert into unique_table values ("-"), ("--"), ("- -"), (" - ") """ @@ -51,10 +51,10 @@ suite("test_auto_partition_behavior") { sql """ alter table unique_table drop partition ${partition1_name} """ // partition ' ' result = sql "show partitions from unique_table" assertEquals(result.size(), 9) - qt_sql3 """ select * from unique_table order by `str` """ + qt_sql3 """ select *,length(str) from unique_table order by `str` """ // modify value sql """ update unique_table set str = "modified" where str in (" ", " ") """ // only " " - qt_sql4 """ select * from unique_table where str = ' ' order by `str` """ // modified + qt_sql4 """ select *,length(str) from unique_table where str = ' ' order by `str` """ // modified qt_sql5 """ select count() from unique_table where str = 'modified' """ // crop qt_sql6 """ select * from unique_table where ((str > ' ! ' || str = 'modified') && str != 'Xxx') order by str """ @@ -83,7 +83,7 @@ suite("test_auto_partition_behavior") { result = sql "show partitions from dup_table" assertEquals(result.size(), 6) sql """ insert into dup_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """ - qt_sql2 """ select * from dup_table order by `str` """ + qt_sql2 """ select *,length(str) from dup_table order by `str` """ result = sql "show partitions from dup_table" assertEquals(result.size(), 6) sql """ insert into dup_table values ("-"), ("--"), ("- -"), (" - ") """ @@ -95,9 +95,9 @@ suite("test_auto_partition_behavior") { sql """ alter table dup_table drop partition ${partition1_name} """ result = sql "show partitions from dup_table" assertEquals(result.size(), 9) - qt_sql3 """ select * from dup_table order by `str` """ + qt_sql3 """ select *,length(str) from dup_table order by `str` """ // crop - qt_sql4 """ select * from dup_table where str > ' ! ' order by str """ + qt_sql4 """ select * ,length(str) from dup_table where str > ' ! ' order by str """ /// agg key table sql "drop table if exists agg_dt6"