Browse Source

docs: fix data conversion issue

RockyJin 4 years atrás
parent
commit
f3b29a5c85
2 changed files with 52 additions and 58 deletions
  1. 27 29
      docs/en_US/sqls/data_types.md
  2. 25 29
      docs/zh_CN/sqls/data_types.md

+ 27 - 29
docs/en_US/sqls/data_types.md

@@ -1,47 +1,45 @@
-# Data types
+Data types
 
 In Kuiper, each column or an expression has a related data type. A data type describes (and constrains) the set of values that a column of that type can hold or an expression of that type can produce.
 
 
 
-## Supported data types
+Supported data types
 
 Below is the list of data types supported.
 
-| #    | Data type | Description                                                  |
-| ---- | --------- | ------------------------------------------------------------ |
-| 1    | bigint    | The int type.                                                |
-| 2    | float     | The float type.                                              |
-| 3    | string    | Text values, comprised of Unicode characters.                |
-| 4    | datetime  | datatime type - *Currently it's NOT supported yet*.          |
-| 5    | boolean   | The boolean type, the value could be ``true`` or ``false``.  |
-| 6    | array     | The array type, can be any types from simple data or struct type (#1 - #5, and #7). |
-| 7    | struct    | The complex type. Set of name/value pairs. Values must be of supported data type. |
+  #   	Data type	Description                             
+  1   	bigint   	The int type.                           
+  2   	float    	The float type.                         
+  3   	string   	Text values, comprised of Unicode characters.
+  4   	datetime 	datatime type - Currently it's NOT supported yet.
+  5   	boolean  	The boolean type, the value could be true or false.
+  6   	array    	The array type, can be any types from simple data or struct type (#1 - #5, and #7).
+  7   	struct   	The complex type. Set of name/value pairs. Values must be of supported data type.
 
-## Compatibility of comparison and calculation
+Compatibility of comparison and calculation
 
-There may be binary operations in each sql clause. In this example, `Select temperature * 2 from demo where temperature > 20`, a calculation operation is used in select clause and a comparison operation is used in the where clause. In the binary operations, if incompatible data types are used, a runtime error will happen and send to the sinks.
+There may be binary operations in each sql clause. In this example, Select temperature * 2 from demo where temperature > 20, a calculation operation is used in select clause and a comparison operation is used in the where clause. In the binary operations, if incompatible data types are used, a runtime error will happen and send to the sinks.
 
 Array and struct are not supported in any binary operations. The compatibility of other data types are listed in below table. Whereas, the row header is the left operand data type and the column header is the right operand data. The value is the compatibility in which Y stands for yes and N stands for no.
 
- #    | bigint | float | string | datetime | boolean |
- ---- | ------ | ----  | ----   | ----     | ---     |
- bigint|  Y    |  Y    |   N    |   N      |   N     |
- float |  Y    |  Y    |   N    |   N      |   N     |
- string|  N    |  N    |   Y    |   N      |   N     |
- datetime| Y   |  Y    | Y if in the valid format | Y | N |
- boolean| N    |  N    |   N    |   N      |   N     |
- 
- The default format for datetime string is ``"2006-01-02T15:04:05.000Z07:00"``
- 
- For `nil` value, we follow the rules:
- 1. Compare with nil always return false
- 2. Calculate with nil always return nil
+  bigint  	float	string	datetime                 	boolean
+  bigint  	Y    	Y     	N                        	N      
+  float   	Y    	Y     	N                        	N      
+  string  	N    	N     	Y                        	N      
+  datetime	Y    	Y     	Y, if in the valid format	Y      
+  boolean 	N    	N     	N                        	N      
 
-## Type conversions
+ The default format for datetime string is "2006-01-02T15:04:05.000Z07:00"
 
-These are the rules governing *data type conversions*:
+ For nil value, we follow the rules:
+
+1. Compare with nil always return false
+2. Calculate with nil always return nil
+
+Type conversions
+
+These are the rules governing data type conversions:
 
 - ...
 - 
-

+ 25 - 29
docs/zh_CN/sqls/data_types.md

@@ -1,49 +1,45 @@
-# 数据类型
+数据类型
 
 在 Kuiper 中,每个列或表达式都有一个相关的数据类型。 数据类型描述(并约束)该类型的列可以容纳的一组值或可以产生的一组表达式。
 
 
 
-## 支持的数据类型
+支持的数据类型
 
 以下是支持的数据类型的列表。
 
-| #    | 数据类型 | 描述                                                         |
-| ---- | -------- | ------------------------------------------------------------ |
-| 1    | bigint   | 整数型                                                       |
-| 2    | float    | 浮点型                                                       |
-| 3    | string   | 文本值,由 Unicode 字符组成。                                |
-| 4    | datetime | 日期时间类型-*目前尚不支持*。                                |
-| 5    | boolean  | 布尔类型,值可以是`true` 或者 `false`。                      |
-| 6    | array    | 数组类型可以是简单数据或结构类型中的任何类型(#1-#5和#7)。 |
-| 7    | struct   | 复杂类型。 名称/值对的集合。 值必须是受支持的数据类型。      |
+  #   	数据类型    	描述                               
+  1   	bigint  	整数型                              
+  2   	float   	浮点型                              
+  3   	string  	文本值,由 Unicode 字符组成。              
+  4   	datetime	日期时间类型-目前尚不支持。                   
+  5   	boolean 	布尔类型,值可以是true 或者 false。          
+  6   	array   	数组类型可以是简单数据或结构类型中的任何类型(#1-#5和#7)。
+  7   	struct  	复杂类型。 名称/值对的集合。 值必须是受支持的数据类型。    
 
-## 比较和计算的兼容性
+比较和计算的兼容性
 
-每个 sql 子句中可能都有二进制操作。 在此示例中,` Select temperature * 2 from demo where temperature > 20`,在 select 子句中使用计算操作,在 where 子句中使用比较操作。 在二进制操作中,如果使用了不兼容的数据类型,则会发生运行时错误并将其发送到目标。
+每个 sql 子句中可能都有二元操作。 在此示例中,Select temperature * 2 from demo where temperature > 20,在 select 子句中使用计算操作,在 where 子句中使用比较操作。 在二操作中,如果使用了不兼容的数据类型,则会发生运行时错误并将其发送到目标。
 
-数组和结构在任何二进制操作中均不受支持。 下表列出了其他数据类型的兼容性。 而行标题是左操作数数据类型,列标题是右操作数数据。 关于兼容性的值,其中 Y 表示是,N 表示否。
+数组和结构在任何二操作中均不受支持。 下表列出了其他数据类型的兼容性。 而行标题是左操作数数据类型,列标题是右操作数数据。 关于兼容性的值,其中 Y 表示是,N 表示否。
 
- #    | bigint | float | string | datetime | boolean |
+  bigint  	float	string	datetime   	boolean
+  bigint  	Y    	Y     	N          	N      
+  float   	Y    	Y     	N          	N      
+  string  	N    	N     	Y          	N      
+  datetime	Y    	Y     	Y, 如为合法数据类型	Y      
+  boolean 	N    	N     	N          	N      
 
- ---- | ------ | ----  | ----   | ----     | ---     |
- bigint|  Y    |  Y    |   N    |   N      |   N     |
- float |  Y    |  Y    |   N    |   N      |   N     |
- string|  N    |  N    |   Y    |   N      |   N     |
- datetime| Y   |  Y    | Y if in the valid format | Y | N |
- boolean| N    |  N    |   N    |   N      |   N     |
+日期时间字符串的默认格式是 "2006-01-02T15:04:05.000Z07:00"
 
-日期时间字符串的默认格式是 `"2006-01-02T15:04:05.000Z07:00"`
+对于 nil 值,我们遵循以下规则:
 
-对于 `nil` 值,我们遵循以下规则:
+1. 与 nil 比较总是返回 false
+2. 用 nil 计算总是返回 nil
 
-  1. 与 nil 比较总是返回 false
-  2. 用 nil 计算总是返回 nil
+类型转换
 
-## 类型转换
-
-这些是控制*数据类型转换*的规则:
+这些是控制数据类型转换的规则:
 
 - ...
 - 
-