bobhan1 commented on code in PR #1295: URL: https://github.com/apache/doris-website/pull/1295#discussion_r1833859690
########## i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/table-design/data-partitioning/manual-partitioning.md: ########## @@ -0,0 +1,118 @@ +--- +{ + "title": "手动分区", + "language": "zh-CN" +} +--- + +<!-- +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. +--> + + +## 分区列 + +- 分区列可以指定一列或多列,分区列必须为 KEY 列。多列分区的使用方式在后面多列分区小结介绍。 + +- 当 `allowPartitionColumnNullable` 为 `true` 时,Range 分区支持使用 NULL 分区列。List Partition 始终不支持 NULL 分区列。 + +- 不论分区列是什么类型,在写分区值时,都需要加双引号。 + +- 分区数量理论上没有上限。 + +- 当不使用分区建表时,系统会自动生成一个和表名同名的,全值范围的分区。该分区对用户不可见,并且不可删改。 + +- 创建分区时不可添加范围重叠的分区。 + +## Range 分区 + +分区列通常为时间列,以方便的管理新旧数据。Range 分区支持的列类型 DATE, DATETIME, TINYINT, SMALLINT, INT, BIGINT, LARGEINT。 + +**分区信息,支持四种写法:** + +1. FIXED RANGE:定义分区的左闭右开区间。 + +```sql +PARTITION BY RANGE(col1[, col2, ...]) +( + PARTITION partition_name1 VALUES [("k1-lower1", "k2-lower1", "k3-lower1",...), ("k1-upper1", "k2-upper1", "k3-upper1", ...)), + PARTITION partition_name2 VALUES [("k1-lower1-2", "k2-lower1-2", ...), ("k1-upper1-2", MAXVALUE, )) +) +``` + +示例如下: + +```sql +PARTITION BY RANGE(`date`) +( + PARTITION `p201701` VALUES [("2017-01-01"), ("2017-02-01")), + PARTITION `p201702` VALUES [("2017-02-01"), ("2017-03-01")), + PARTITION `p201703` VALUES [("2017-03-01"), ("2017-04-01")) +) Review Comment: 这个pr先改结构和链接吧,后面再单独提pr改这里面每一个的内容 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org