You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/11/13 09:11:32 UTC

[incubator-doris] branch master updated: [Doc] REPLACE_IF_NOT_NULL document modification (#7100)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new d4c0156  [Doc] REPLACE_IF_NOT_NULL document modification (#7100)
d4c0156 is described below

commit d4c0156e0ff5620bf2d50368780e7ada8f18f2d1
Author: jiafeng.zhang <zh...@gmail.com>
AuthorDate: Sat Nov 13 17:11:20 2021 +0800

    [Doc] REPLACE_IF_NOT_NULL document modification (#7100)
    
    REPLACE_IF_NOT_NULL document modification
---
 .../Create/CREATE-TABLE.md                         | 55 +++++++++++-----------
 .../sql-statements/Data Definition/CREATE TABLE.md | 23 ++++-----
 .../Create/CREATE-TABLE.md                         |  7 +--
 .../sql-statements/Data Definition/CREATE TABLE.md | 12 ++---
 4 files changed, 50 insertions(+), 47 deletions(-)

diff --git a/docs/en/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md b/docs/en/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
index a2a706b..156fc51 100644
--- a/docs/en/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
+++ b/docs/en/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
@@ -108,7 +108,7 @@ distribution_info
             MIN: Find the minimum value. Suitable for numeric types.
             MAX: Find the maximum value. Suitable for numeric types.
             REPLACE: Replace. For rows with the same dimension column, the index column will be imported in the order of import, and the last imported will replace the first imported.
-            REPLACE_IF_NOT_NULL: non-null value replacement. The difference with REPLACE is that there is no replacement for null values.
+            REPLACE_IF_NOT_NULL: non-null value replacement. The difference with REPLACE is that there is no replacement for null values. It should be noted here that the default value should be NULL, not an empty string. If it is an empty string, you should replace it with an empty string.
             HLL_UNION: The aggregation method of HLL type columns, aggregated by HyperLogLog algorithm.
             BITMAP_UNION: The aggregation mode of BIMTAP type columns, which performs the union aggregation of bitmaps.
             ```
@@ -492,33 +492,34 @@ distribution_info
     ```sql
     CREATE TABLE example_db.table_hash
     (
-   		k1 TINYINT,
-    	k2 DECIMAL(10, 2) DEFAULT "10.5"
-    )
-    DISTRIBUTED BY HASH(k1) BUCKETS 32
-    PROPERTIES (
-        "replication_allocation"="tag.location.group_a:1, tag.location.group_b:2"
-    );
 
-    CREATE TABLE example_db.dynamic_partition
-    (
-    	k1 DATE,
-    	k2 INT,
-    	k3 SMALLINT,
-    	v1 VARCHAR(2048),
-    	v2 DATETIME DEFAULT "2014-02-04 15:36:00"
-    )
-    PARTITION BY RANGE (k1) ()
-    DISTRIBUTED BY HASH(k2) BUCKETS 32
-    PROPERTIES(
-        "dynamic_partition.time_unit" = "DAY",
-        "dynamic_partition.start" = "-3",
-        "dynamic_partition.end" = "3",
-        "dynamic_partition.prefix" = "p",
-        "dynamic_partition.buckets" = "32",
-        "dynamic_partition."replication_allocation" = "tag.location.group_a:3"
-     );
-    ```
+   		k1 TINYINT,
+   		k2 DECIMAL(10, 2) DEFAULT "10.5"
+   	)
+   	DISTRIBUTED BY HASH(k1) BUCKETS 32
+   	PROPERTIES (
+   	    "replication_allocation"="tag.location.group_a:1, tag.location.group_b:2"
+   	);
+   	
+   	CREATE TABLE example_db.dynamic_partition
+   	(
+   		k1 DATE,
+   		k2 INT,
+   		k3 SMALLINT,
+   		v1 VARCHAR(2048),
+   		v2 DATETIME DEFAULT "2014-02-04 15:36:00"
+   	)
+   	PARTITION BY RANGE (k1) ()
+   	DISTRIBUTED BY HASH(k2) BUCKETS 32
+   	PROPERTIES(
+   	    "dynamic_partition.time_unit" = "DAY",
+   	    "dynamic_partition.start" = "-3",
+   	    "dynamic_partition.end" = "3",
+   	    "dynamic_partition.prefix" = "p",
+   	    "dynamic_partition.buckets" = "32",
+   	    "dynamic_partition."replication_allocation" = "tag.location.group_a:3"
+   	 );
+   	```
 ### Keywords
 
     CREATE, TABLE
diff --git a/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md b/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md
index 92e4829..fe7fbbd 100644
--- a/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md	
+++ b/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md	
@@ -93,7 +93,7 @@ Syntax:
 
        * SUM、MAX、MIN、REPLACE
        * HLL_UNION: Only for HLL type
-       * REPLACE_IF_NOT_NULL: The meaning of this aggregation type is that substitution will occur if and only if the newly imported data is a non-null value. If the newly imported data is null, Doris will still retain the original value. Note: if NOT NULL is specified in the REPLACE_IF_NOT_NULL column when the user creates the table, Doris will convert it to NULL and will not report an error to the user. Users can leverage this aggregate type to achieve importing some of columns.
+       * REPLACE_IF_NOT_NULL: The meaning of this aggregation type is that substitution will occur if and only if the newly imported data is a non-null value. If the newly imported data is null, Doris will still retain the original value. Note: if NOT NULL is specified in the REPLACE_IF_NOT_NULL column when the user creates the table, Doris will convert it to NULL and will not report an error to the user. Users can leverage this aggregate type to achieve importing some of columns .**It s [...]
        * BITMAP_UNION: Only for BITMAP type
     Allow NULL: Default is NOT NULL. NULL value should be represented as `\N` in load source file.
     Notice: The origin value of BITMAP_UNION column should be TINYINT, SMALLINT, INT, BIGINT.
@@ -144,7 +144,7 @@ Syntax:
         ```
     
         For different broker, the broker properties are different
-    Notice:
+        Notice:
         Files name in "path" is separated by ",". If file name includes ",", use "%2c" instead.     If file name includes "%", use "%25" instead.
         Support CSV and Parquet. Support GZ, BZ2, LZ4, LZO(LZOP)
     3) For hive, properties should include:
@@ -187,7 +187,7 @@ Syntax:
             ...
             )
             ```
-
+        
         Explain:
             Use the specified key column and the specified range of values for partitioning.
             1) Partition name only support [A-z0-9_]
@@ -223,7 +223,7 @@ Syntax:
                 ...
                 )
             ```
-
+        
             Explain:
                 Use the specified key column and the formulated enumeration value for partitioning.
                 1) Partition name only support [A-z0-9_]
@@ -232,10 +232,10 @@ Syntax:
                 3) Partition is a collection of enumerated values, partition values cannot be duplicated between partitions
                 4) NULL values cannot be imported
                 5) partition values cannot be defaulted, at least one must be specified
-
+        
         2) Multi-column partition
             Syntax.
-
+        
             ```
                 PARTITION BY LIST(k1, k2)
                 (
@@ -244,7 +244,7 @@ Syntax:
                 ...
                 )
             ```
-
+        
             Explain:
                 1) the partition of a multi-column partition is a collection of tuple enumeration values
                 2) The number of tuple values per partition must be equal to the number of columns in the partition
@@ -252,9 +252,9 @@ Syntax:
 
 6. distribution_desc
     1) Hash
-    Syntax:
+       Syntax:
         `DISTRIBUTED BY HASH (k1[,k2 ...]) [BUCKETS num]`
-    Explain:
+       Explain:
         The default buckets is 10.
 7. PROPERTIES
     1) If ENGINE type is olap. User can specify storage medium, cooldown time and replication   number:
@@ -317,6 +317,7 @@ Syntax:
        dynamic_partition.create_history_partition: specifies whether create history partitions, default value is false
        dynamic_partition.history_partition_num: used to specify the number of history partitions when enable create_history_partition
        dynamic_partition.reserved_history_periods: Used to specify the range of reserved history periods
+       
        ```
     5)  You can create multiple Rollups in bulk when building a table
     grammar:
@@ -325,9 +326,9 @@ Syntax:
                      [FROM from_index_name]
                       [PROPERTIES ("key"="value", ...)],...)
     ```
-
+    
     6) if you want to use the inmemory table feature, specify it in properties
-
+    
         ```
         PROPERTIES (
            "in_memory"="true"
diff --git a/docs/zh-CN/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md b/docs/zh-CN/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
index 7ef911b..b240f0a 100644
--- a/docs/zh-CN/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
+++ b/docs/zh-CN/sql-reference-v2/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE.md
@@ -108,11 +108,12 @@ distribution_info
             MIN:求最小值。适合数值类型。
             MAX:求最大值。适合数值类型。
             REPLACE:替换。对于维度列相同的行,指标列会按照导入的先后顺序,后倒入的替换先导入的。
-            REPLACE_IF_NOT_NULL:非空值替换。和 REPLACE 的区别在于对于null值,不做替换。
+            REPLACE_IF_NOT_NULL:非空值替换。和 REPLACE 的区别在于对于null值,不做替换。这里要注意的是字段默认值要给NULL,而不能是空字符串,如果是空字符串,会给你替换成空字符串。
             HLL_UNION:HLL 类型的列的聚合方式,通过 HyperLogLog 算法聚合。
             BITMAP_UNION:BIMTAP 类型的列的聚合方式,进行位图的并集聚合。
             ```
             
+        
         示例:
         
             ```
@@ -124,7 +125,7 @@ distribution_info
             v3 HLL HLL_UNION,
             v4 INT SUM NOT NULL DEFAULT "1" COMMENT "This is column v4"
             ```
-        
+    
 *  `index_definition_list`
 
     索引列表定义:
@@ -206,7 +207,7 @@ distribution_info
         ```
 
 * `distribution_desc`
-    
+  
     定义数据分桶方式。
 
     `DISTRIBUTED BY HASH (k1[,k2 ...]) [BUCKETS num]`
diff --git a/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md b/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md
index 9b0dcb1..07b8f9e 100644
--- a/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md	
+++ b/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md	
@@ -96,7 +96,7 @@ under the License.
        * SUM、MAX、MIN、REPLACE
        * HLL_UNION(仅用于HLL列,为HLL独有的聚合方式)、
        * BITMAP_UNION(仅用于 BITMAP 列,为 BITMAP 独有的聚合方式)、
-       * REPLACE_IF_NOT_NULL:这个聚合类型的含义是当且仅当新导入数据是非NULL值时会发生替换行为,如果新导入的数据是NULL,那么Doris仍然会保留原值。注意:如果用在建表时REPLACE_IF_NOT_NULL列指定了NOT NULL,那么Doris仍然会将其转化NULL,不会向用户报错。用户可以借助这个类型完成部分列导入的功能。
+       * REPLACE_IF_NOT_NULL:这个聚合类型的含义是当且仅当新导入数据是非NULL值时会发生替换行为,如果新导入的数据是NULL,那么Doris仍然会保留原值。注意:如果用在建表时REPLACE_IF_NOT_NULL列指定了NOT NULL,那么Doris仍然会将其转化NULL,不会向用户报错。用户可以借助这个类型完成部分列导入的功能。**这里要注意的是字段默认值要给NULL,而不能是空字符串,如果是空字符串,会给你替换成空字符串**。
        * 该类型只对聚合模型(key_desc的type为AGGREGATE KEY)有用,其它模型不需要指这个。
 
     是否允许为NULL: 默认允许为 NULL。NULL 值在导入数据中用 \N 来表示
@@ -211,7 +211,7 @@ under the License.
             注意:
                 1) 分区一般用于时间维度的数据管理
                 2) 有数据回溯需求的,可以考虑首个分区为空分区,以便后续增加分区
-
+        
         2)Fixed Range
             语法:
             ```
@@ -239,7 +239,7 @@ under the License.
                 ...
                 )
             ```
-
+        
             说明:
                 使用指定的 key 列和制定的枚举值进行分区。
                 1) 分区名称仅支持字母开头,字母、数字和下划线组成
@@ -248,10 +248,10 @@ under the License.
                 3) 分区为枚举值集合,各个分区之间分区值不能重复
                 4) 不可导入 NULL 值
                 5) 分区值不能缺省,必须指定至少一个
-
+        
         2) 多列分区
             语法:
-
+        
             ```
                 PARTITION BY LIST(k1, k2)
                 (
@@ -260,7 +260,7 @@ under the License.
                 ...
                 )
             ```
-
+        
             说明:
                 1) 多列分区的分区是元组枚举值的集合
                 2) 每个元组值的个数必须与分区列个数相等

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org