hailin0 commented on code in PR #6757:
URL: https://github.com/apache/seatunnel/pull/6757#discussion_r1580523059


##########
docs/zh/concept/sql-config.md:
##########
@@ -0,0 +1,187 @@
+# SQL配置文件
+
+## SQL配置文件结构
+
+`SQL`配置文件类似下面。
+
+### SQL
+
+```sql
+/* config
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+*/
+
+CREATE TABLE source_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'query' = 'select * from source',
+  'properties'= '{
+    useSSL = false,
+    rewriteBatchedStatements = true
+  }',
+  'type'='source'
+);
+
+CREATE TABLE sink_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'generate_sink_sql' = 'true',
+  'database' = 'seatunnel',
+  'table' = 'sink',
+  'type'='sink'
+);
+
+CREATE TABLE temp1 AS SELECT id, name, age, email FROM source_table;
+
+INSERT INTO sink_table SELECT * FROM temp1;
+```
+
+## `SQL`配置文件说明
+
+### 通用配置
+
+```sql
+/* config
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+*/
+```
+
+在`SQL`文件中通过 `/* config */` 注释定义通用配置部分,内部可以使用`hocon`格式定义通用的配置,如`env`等。
+
+### SOURCE SQL语法
+
+```sql
+CREATE TABLE source_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'query' = 'select * from source',
+  'properties' = '{
+    useSSL = false,
+    rewriteBatchedStatements = true
+  }',
+  'type'='source'

Review Comment:
   move to `connector` after



##########
docs/zh/concept/sql-config.md:
##########
@@ -0,0 +1,187 @@
+# SQL配置文件
+
+## SQL配置文件结构
+
+`SQL`配置文件类似下面。
+
+### SQL
+
+```sql
+/* config
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+*/
+
+CREATE TABLE source_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'query' = 'select * from source',
+  'properties'= '{
+    useSSL = false,
+    rewriteBatchedStatements = true
+  }',
+  'type'='source'
+);
+
+CREATE TABLE sink_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'generate_sink_sql' = 'true',
+  'database' = 'seatunnel',
+  'table' = 'sink',
+  'type'='sink'
+);
+
+CREATE TABLE temp1 AS SELECT id, name, age, email FROM source_table;
+
+INSERT INTO sink_table SELECT * FROM temp1;
+```
+
+## `SQL`配置文件说明
+
+### 通用配置
+
+```sql
+/* config
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+*/
+```
+
+在`SQL`文件中通过 `/* config */` 注释定义通用配置部分,内部可以使用`hocon`格式定义通用的配置,如`env`等。
+
+### SOURCE SQL语法
+
+```sql
+CREATE TABLE source_table WITH (
+  'connector'='jdbc',
+  'url' = 'jdbc:mysql://localhost:3306/seatunnel',
+  'driver' = 'com.mysql.cj.jdbc.Driver',
+  'user' = 'root',
+  'password' = '123456',
+  'query' = 'select * from source',
+  'properties' = '{
+    useSSL = false,
+    rewriteBatchedStatements = true
+  }',
+  'type'='source'

Review Comment:
   move `type` to `connector` after



-- 
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]

Reply via email to