diff --git a/be/test/vec/function/function_like_test.cpp b/be/test/vec/function/function_like_test.cpp index 44fcb67f3e..794bc8c5ea 100644 --- a/be/test/vec/function/function_like_test.cpp +++ b/be/test/vec/function/function_like_test.cpp @@ -15,12 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include - +#include #include -#include -#include "common/status.h" #include "function_test_util.h" #include "gtest/gtest_pred_impl.h" #include "testutil/any_type.h" @@ -34,44 +31,53 @@ namespace doris::vectorized { TEST(FunctionLikeTest, like) { std::string func_name = "like"; - DataSet data_set = {// sub_string - {{std::string("abc"), std::string("%b%")}, uint8_t(1)}, - {{std::string("abc"), std::string("%ad%")}, uint8_t(0)}, - // end with - {{std::string("abc"), std::string("%c")}, uint8_t(1)}, - {{std::string("ab"), std::string("%c")}, uint8_t(0)}, - // start with - {{std::string("abc"), std::string("a%")}, uint8_t(1)}, - {{std::string("bc"), std::string("a%")}, uint8_t(0)}, - // equals - {{std::string(""), std::string("")}, uint8_t(1)}, - {{std::string(""), std::string(" ")}, uint8_t(0)}, - {{std::string(" "), std::string(" ")}, uint8_t(1)}, - {{std::string(" "), std::string("")}, uint8_t(0)}, - {{std::string("abc"), std::string("")}, uint8_t(0)}, - {{std::string("abc"), std::string(" ")}, uint8_t(0)}, - {{std::string("abc"), std::string("abc")}, uint8_t(1)}, - {{std::string("abc"), std::string("ab")}, uint8_t(0)}, - // full regexp match - {{std::string("abcd"), std::string("a_c%")}, uint8_t(1)}, - {{std::string("abcd"), std::string("a_d%")}, uint8_t(0)}, - {{std::string("abc"), std::string("__c")}, uint8_t(1)}, - {{std::string("abc"), std::string("_c")}, uint8_t(0)}, - {{std::string("abc"), std::string("_b_")}, uint8_t(1)}, - {{std::string("abc"), std::string("_a_")}, uint8_t(0)}, - {{std::string("abc"), std::string("a__")}, uint8_t(1)}, - {{std::string("abc"), std::string("a_")}, uint8_t(0)}, - // null - {{std::string("abc"), Null()}, Null()}, - {{Null(), std::string("_x__ab%")}, Null()}}; + DataSet data_set = { + // sub_string + {{std::string("abc"), std::string("%b%")}, uint8_t(1)}, + {{std::string("abc"), std::string("%ad%")}, uint8_t(0)}, + // end with + {{std::string("abc"), std::string("%c")}, uint8_t(1)}, + {{std::string("ab"), std::string("%c")}, uint8_t(0)}, + // start with + {{std::string("abc"), std::string("a%")}, uint8_t(1)}, + {{std::string("bc"), std::string("a%")}, uint8_t(0)}, + // equals + {{std::string(""), std::string("")}, uint8_t(1)}, + {{std::string(""), std::string(" ")}, uint8_t(0)}, + {{std::string(" "), std::string(" ")}, uint8_t(1)}, + {{std::string(" "), std::string("")}, uint8_t(0)}, + {{std::string("abc"), std::string("")}, uint8_t(0)}, + {{std::string("abc"), std::string(" ")}, uint8_t(0)}, + {{std::string("abc"), std::string("abc")}, uint8_t(1)}, + {{std::string("abc"), std::string("ab")}, uint8_t(0)}, + // full regexp match + {{std::string("abcd"), std::string("a_c%")}, uint8_t(1)}, + {{std::string("abcd"), std::string("a_d%")}, uint8_t(0)}, + {{std::string("abc"), std::string("__c")}, uint8_t(1)}, + {{std::string("abc"), std::string("_c")}, uint8_t(0)}, + {{std::string("abc"), std::string("_b_")}, uint8_t(1)}, + {{std::string("abc"), std::string("_a_")}, uint8_t(0)}, + {{std::string("abc"), std::string("a__")}, uint8_t(1)}, + {{std::string("abc"), std::string("a_")}, uint8_t(0)}, + // null + {{std::string("abc"), Null()}, Null()}, + {{Null(), std::string("_x__ab%")}, Null()}, + // escape chars + {{std::string("facebook_10008_T1+T2-ALL_AAA-VO_LowestCost_20230830_HSJ"), + std::string("%facebook_10008_T1+T2%")}, + uint8_t(1)}, + {{std::string("!z23]"), std::string("_[z]%")}, uint8_t(0)}, + {{std::string("[123]"), std::string("%[1.*]%")}, uint8_t(0)}, + {{std::string("1\\b\\b"), std::string("%_\\b\\b%")}, uint8_t(1)}, + {{std::string("1\\d\\d"), std::string("%_\\d\\d%")}, uint8_t(1)}, + {{std::string("1dd"), std::string("%_dd%")}, + uint8_t(1)} // this case can't be same as regression-test because of FE's string escape operation + }; // pattern is constant value - InputTypeSet const_pattern_input_types = {TypeIndex::String, Consted {TypeIndex::String}}; - for (const auto& line : data_set) { - DataSet const_pattern_dataset = {line}; - static_cast(check_function(func_name, const_pattern_input_types, - const_pattern_dataset)); - } + InputTypeSet const_pattern_input_types = {TypeIndex::String, TypeIndex::String}; + static_cast( + check_function(func_name, const_pattern_input_types, data_set)); } TEST(FunctionLikeTest, regexp) { diff --git a/docs/en/docs/advanced/partition/auto-partition.md b/docs/en/docs/advanced/partition/auto-partition.md index df28dea010..1f9e8fa1e9 100644 --- a/docs/en/docs/advanced/partition/auto-partition.md +++ b/docs/en/docs/advanced/partition/auto-partition.md @@ -110,7 +110,7 @@ When building a table, use the following syntax to populate [CREATE-TABLE](../.. 1. AUTO RANGE PARTITION ```sql - CREATE TABLE `${tblDate}` ( + CREATE TABLE `date_table` ( `TIME_STAMP` datev2 NOT NULL COMMENT 'Date of collection' ) ENGINE=OLAP DUPLICATE KEY(`TIME_STAMP`) @@ -126,7 +126,7 @@ When building a table, use the following syntax to populate [CREATE-TABLE](../.. 2. AUTO LIST PARTITION ```sql - CREATE TABLE `${tblName1}` ( + CREATE TABLE `str_table` ( `str` varchar not null ) ENGINE=OLAP DUPLICATE KEY(`str`) @@ -141,11 +141,11 @@ When building a table, use the following syntax to populate [CREATE-TABLE](../.. ### Using constraints -1. Currently the AUTO RANGE PARTITION function supports only one partition column; -2. In AUTO RANGE PARTITION, the partition function supports only `date_trunc` and the partition column supports only `DATE` or `DATETIME` type; -3. In AUTO LIST PARTITION, function calls are not supported. Partitioned columns support `BOOLEAN`, `TINYINT`, `SMALLINT`, `INT`, `BIGINT`, `LARGEINT`, `DATE`, `DATETIME`, `CHAR`, `VARCHAR` data-types, and partitioned values are enum values. -4. In AUTO LIST PARTITION, a separate new PARTITION is created for each fetch of a partition column for which the corresponding partition does not currently exist. -5. The partition column for AUTO PARTITION must be a NOT NULL column. +1. The partition column for AUTO PARTITION must be a NOT NULL column; +2. In an AUTO LIST PARTITION, **the length of the partition name must not exceed 50**. This length is derived from the splicing and escaping of the contents of the partition columns on the corresponding rows of data, so the actual allowable length may be shorter; +3. In AUTO RANGE PARTITION, the partition function supports only `date_trunc` and the partition column supports only `DATE` or `DATETIME` type; +4. In AUTO LIST PARTITION, function calls are not supported. Partitioned columns support `BOOLEAN`, `TINYINT`, `SMALLINT`, `INT`, `BIGINT`, `LARGEINT`, `DATE`, `DATETIME`, `CHAR`, `VARCHAR` data-types, and partitioned values are enum values; +5. In AUTO LIST PARTITION, a separate new PARTITION is created for each fetch of a partition column for which the corresponding partition does not currently exist. ## Sample Scenarios @@ -252,6 +252,7 @@ ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = If ## caveat +- Like a normal partition table, AUTO PARTITION supports multi-column partitioning, and there is no difference in syntax. - If a partition is created during the insertion or import of data and the entire import process does not complete (fails or is cancelled), the created partition is not automatically deleted. - Tables that use AUTO PARTITION only have their partitions created automatically instead of manually. The original use of the table and the partitions it creates is the same as for non-AUTO PARTITION tables or partitions. - To prevent accidental creation of too many partitions, we use the [FE Configuration](../../admin-manual/config/fe-config) `max_auto_partition_num` controls the maximum number of partitions an AUTO PARTITION table can hold. This value can be adjusted if necessary diff --git a/docs/en/docs/install/source-install/compilation-arm.md b/docs/en/docs/install/source-install/compilation-arm.md index a302a9e269..e500561da5 100644 --- a/docs/en/docs/install/source-install/compilation-arm.md +++ b/docs/en/docs/install/source-install/compilation-arm.md @@ -50,7 +50,7 @@ $> cat /proc/cpuinfo model name : Phytium,FT-2000+/64 ``` -2. CentOS 8.4 +2. CentOS 7.9 or higher ```shell $> lsb_release -a @@ -79,7 +79,7 @@ Codename: AltArch ### Software Environment Installation Command - +

1. Create root directories for pacakges diff --git a/docs/zh-CN/docs/advanced/partition/auto-partition.md b/docs/zh-CN/docs/advanced/partition/auto-partition.md index d5b8343d69..a15537dcb8 100644 --- a/docs/zh-CN/docs/advanced/partition/auto-partition.md +++ b/docs/zh-CN/docs/advanced/partition/auto-partition.md @@ -110,7 +110,7 @@ PROPERTIES ( 1. AUTO RANGE PARTITION ```sql - CREATE TABLE `${tblDate}` ( + CREATE TABLE `date_table` ( `TIME_STAMP` datev2 NOT NULL COMMENT '采集日期' ) ENGINE=OLAP DUPLICATE KEY(`TIME_STAMP`) @@ -126,7 +126,7 @@ PROPERTIES ( 2. AUTO LIST PARTITION ```sql - CREATE TABLE `${tblName1}` ( + CREATE TABLE `str_table` ( `str` varchar not null ) ENGINE=OLAP DUPLICATE KEY(`str`) @@ -141,11 +141,11 @@ PROPERTIES ( ### 约束 -1. 当前自动分区功能仅支持一个分区列; -2. 在AUTO RANGE PARTITION中,分区函数仅支持 `date_trunc`,分区列仅支持 `DATE` 或者 `DATETIME` 格式; -3. 在AUTO LIST PARTITION中,不支持函数调用,分区列支持 `BOOLEAN`, `TINYINT`, `SMALLINT`, `INT`, `BIGINT`, `LARGEINT`, `DATE`, `DATETIME`, `CHAR`, `VARCHAR` 数据类型,分区值为枚举值。 -4. 在AUTO LIST PARTITION中,分区列的每个当前不存在对应分区的取值,都会创建一个独立的新PARTITION。 -5. 自动分区的分区列必须为 NOT NULL 列。 +1. 自动分区的分区列必须为 NOT NULL 列。 +2. 在AUTO LIST PARTITION中,**分区名长度不得超过 50**. 该长度来自于对应数据行上各分区列内容的拼接与转义,因此实际容许长度可能更短。 +3. 在AUTO RANGE PARTITION中,分区函数仅支持 `date_trunc`,分区列仅支持 `DATE` 或者 `DATETIME` 格式; +4. 在AUTO LIST PARTITION中,不支持函数调用,分区列支持 `BOOLEAN`, `TINYINT`, `SMALLINT`, `INT`, `BIGINT`, `LARGEINT`, `DATE`, `DATETIME`, `CHAR`, `VARCHAR` 数据类型,分区值为枚举值。 +5. 在AUTO LIST PARTITION中,分区列的每个当前不存在对应分区的取值,都会创建一个独立的新PARTITION。 ## 场景示例 @@ -252,6 +252,7 @@ ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = If ## 注意事项 +- 如同普通分区表一样,AUTO PARTITION支持多列分区,语法并无区别。 - 在数据的插入或导入过程中如果创建了分区,而整个导入过程没有完成(失败或被取消),被创建的分区不会被自动删除。 - 使用AUTO PARTITION的表,只是分区创建方式上由手动转为了自动。表及其所创建分区的原本使用方法都与非AUTO PARTITION的表或分区相同。 - 为防止意外创建过多分区,我们通过[FE配置项](../../admin-manual/config/fe-config)中的`max_auto_partition_num`控制了一个AUTO PARTITION表最大容纳分区数。如有需要可以调整该值 diff --git a/docs/zh-CN/docs/install/source-install/compilation-arm.md b/docs/zh-CN/docs/install/source-install/compilation-arm.md index 3eadab430f..4f3ed1428a 100644 --- a/docs/zh-CN/docs/install/source-install/compilation-arm.md +++ b/docs/zh-CN/docs/install/source-install/compilation-arm.md @@ -52,7 +52,7 @@ $> cat /proc/cpuinfo model name : Phytium,FT-2000+/64 ``` -2. CentOS 8.4 +2. CentOS 7.9 及以上 ```shell $> lsb_release -a @@ -83,7 +83,7 @@ Codename: AltArch ### 软件环境安装命令 - +

1. 创建软件下载安装包根目录和软件安装根目录 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 b1b4161f94..9323b5d255 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 @@ -34,7 +34,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; public class PartitionExprUtil { @@ -160,8 +159,7 @@ public class PartitionExprUtil { partitionName += getFormatPartitionValue(filterStr); if (hasStringType) { if (partitionName.length() > 50) { - partitionName = partitionName.substring(0, 30) + Math.abs(Objects.hash(partitionName)) - + "_" + System.currentTimeMillis(); + throw new AnalysisException("Partition name's length is over limit of 50. abort to create."); } } } else { diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_list_partition.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_list_partition.groovy index 02a16da888..f90f025170 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_list_partition.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_list_partition.groovy @@ -271,28 +271,6 @@ suite("test_auto_list_partition") { logger.info("${result12}") assertEquals(result12.size(), 4) - sql "drop table if exists test_list_many_column3" - sql """ - CREATE TABLE test_list_many_column3 ( - id int not null, - k largeint not null, - str varchar not null - ) - AUTO PARTITION BY LIST (`id`, `k`, `str`) - ( - ) - DISTRIBUTED BY HASH(`k`) BUCKETS 16 - PROPERTIES ( - "replication_allocation" = "tag.location.default: 1" - ); - """ - sql """ insert into test_list_many_column3 values (1,1,"asd"), (-1,-1,"vdf");""" - sql """ insert into test_list_many_column3 values (2,2,"xxx"), (-3,-3,"qwe");""" - sql """ insert into test_list_many_column3 values (5,5,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA")""" - result12 = sql "show partitions from test_list_many_column3" - logger.info("${result12}") - assertEquals(result12.size(), 5) - sql "drop table if exists stream_load_list_test_table_string_key" sql """ CREATE TABLE `stream_load_list_test_table_string_key`( @@ -309,10 +287,11 @@ suite("test_auto_list_partition") { """ sql """ insert into stream_load_list_test_table_string_key values (1,"20"), (2," ");""" sql """ insert into stream_load_list_test_table_string_key values (3,"!"), (4,"! ");""" - sql """ insert into stream_load_list_test_table_string_key values (5,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA")""" + exception "Partition name's length is over limit of 50." + } result12 = sql "show partitions from stream_load_list_test_table_string_key" logger.info("${result12}") - assertEquals(result12.size(), 5) - - + assertEquals(result12.size(), 4) } 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 af81060bd2..af37cf8cf0 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 @@ -304,4 +304,24 @@ suite("test_auto_partition_behavior") { """ exception "If support auto partition and dynamic partition at same time, they must have the same interval unit." } + + // prohibit too long value for partition column + sql "drop table if exists `long_value`" + sql """ + CREATE TABLE `long_value` ( + `str` varchar not null + ) + DUPLICATE KEY(`str`) + AUTO PARTITION BY LIST (`str`) + () + DISTRIBUTED BY HASH(`str`) BUCKETS 1 + PROPERTIES ( + "replication_num" = "1" + ); + """ + test{ + sql """insert into `long_value` values ("jwklefjklwehrnkjlwbfjkwhefkjhwjkefhkjwehfkjwehfkjwehfkjbvkwebconqkcqnocdmowqmosqmojwnqknrviuwbnclkmwkj");""" + + exception "Partition name's length is over limit of 50." + } }