Hisoka-X commented on code in PR #3296:
URL:
https://github.com/apache/incubator-seatunnel/pull/3296#discussion_r1014965944
##########
docs/en/concept/schema-feature.md:
##########
@@ -0,0 +1,82 @@
+# Intro to schema feature
+
+## Why we need schema
+
+Some nosql databases are not strongly limited schema, so the schema cannot be
obtained through the api. At this time, a schema needs to be defined to convert
to SeaTunnelRowType and obtain data.
Review Comment:
```suggestion
Some NoSQL databases or message queue are not strongly limited schema, so
the schema cannot be obtained through the api. At this time, a schema needs to
be defined to convert to SeaTunnelRowType and obtain data.
```
##########
docs/en/concept/schema-feature.md:
##########
@@ -0,0 +1,82 @@
+# Intro to schema feature
+
+## Why we need schema
+
+Some nosql databases are not strongly limited schema, so the schema cannot be
obtained through the api. At this time, a schema needs to be defined to convert
to SeaTunnelRowType and obtain data.
+
+## What type supported at now
+
+| Data type | Description |
+| :-------- | :----------------------------------------------------------- |
+| string | string |
+| boolean | boolean |
+| tinyint | -128 to 127 regular. 0 to 255 unsigned*. Specify the maximum
number of digits in parentheses. |
+| smallint | -32768 to 32767 General. 0 to 65535 unsigned*. Specify the
maximum number of digits in parentheses. |
+| int | All numbers from -2,147,483,648 to 2,147,483,647 are allowed. |
+| bigint | All numbers between -9,223,372,036,854,775,808 and
9,223,372,036,854,775,807 are allowed. |
+| float | Float-precision numeric data from -1.79E+308 to 1.79E+308. |
+| double | Double precision floating point. Handle most decimals. |
+| decimal | DOUBLE type stored as a string, allowing a fixed decimal point. |
+| null | null |
+| bytes | bytes. |
+| date | Only the date is stored. From January 1, 0001 to December 31,
9999. |
+| time | Only store time. Accuracy is 100 nanoseconds. |
+| timestamp | Stores a unique number that is updated whenever a row is created
or modified. timestamp is based on the internal clock and does not correspond
to real time. There can only be one timestamp variable per table. |
+| row | Row type,can be nested. |
+
+## How to use schema
+
+### step1: Configure schema in config
+
+```
+source {
+ FakeSource {
+ parallelism = 2
+ result_table_name = "fake"
+ row.num = 16
+ schema = {
+ fields {
+ id = bigint
+ c_map = "map<string, smallint>"
+ c_array = "array<tinyint>"
+ c_string = string
+ c_boolean = boolean
+ c_tinyint = tinyint
+ c_smallint = smallint
+ c_int = int
+ c_bigint = bigint
+ c_float = float
+ c_double = double
+ c_decimal = "decimal(2, 1)"
+ c_bytes = bytes
+ c_date = date
+ c_timestamp = timestamp
+ }
+ }
+ }
+}
+```
+
+step2:Add dependency
Review Comment:
The following is an introduction for developers. It is not necessary to put
it here. This article is mainly to provide an introduction for users.
##########
docs/en/concept/schema-feature.md:
##########
@@ -0,0 +1,82 @@
+# Intro to schema feature
+
+## Why we need schema
+
+Some nosql databases are not strongly limited schema, so the schema cannot be
obtained through the api. At this time, a schema needs to be defined to convert
to SeaTunnelRowType and obtain data.
+
+## What type supported at now
+
+| Data type | Description |
+| :-------- | :----------------------------------------------------------- |
+| string | string |
+| boolean | boolean |
+| tinyint | -128 to 127 regular. 0 to 255 unsigned*. Specify the maximum
number of digits in parentheses. |
+| smallint | -32768 to 32767 General. 0 to 65535 unsigned*. Specify the
maximum number of digits in parentheses. |
+| int | All numbers from -2,147,483,648 to 2,147,483,647 are allowed. |
+| bigint | All numbers between -9,223,372,036,854,775,808 and
9,223,372,036,854,775,807 are allowed. |
+| float | Float-precision numeric data from -1.79E+308 to 1.79E+308. |
+| double | Double precision floating point. Handle most decimals. |
+| decimal | DOUBLE type stored as a string, allowing a fixed decimal point. |
+| null | null |
+| bytes | bytes. |
+| date | Only the date is stored. From January 1, 0001 to December 31,
9999. |
+| time | Only store time. Accuracy is 100 nanoseconds. |
+| timestamp | Stores a unique number that is updated whenever a row is created
or modified. timestamp is based on the internal clock and does not correspond
to real time. There can only be one timestamp variable per table. |
+| row | Row type,can be nested. |
+
+## How to use schema
+
+### step1: Configure schema in config
+
+```
+source {
+ FakeSource {
+ parallelism = 2
+ result_table_name = "fake"
+ row.num = 16
+ schema = {
+ fields {
+ id = bigint
+ c_map = "map<string, smallint>"
+ c_array = "array<tinyint>"
+ c_string = string
+ c_boolean = boolean
+ c_tinyint = tinyint
+ c_smallint = smallint
+ c_int = int
+ c_bigint = bigint
+ c_float = float
+ c_double = double
+ c_decimal = "decimal(2, 1)"
+ c_bytes = bytes
+ c_date = date
+ c_timestamp = timestamp
+ }
+ }
+ }
+}
+```
Review Comment:
Please Add `When we should use it or not?`, because I can't know I can use
schema on which source , I can't use schema on which source. (just only need
metioned the connector config have schema key can use this feature)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]