You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by gi...@apache.org on 2026/09/10 15:59:17 UTC

(seatunnel) branch gh-readonly-queue/dev/pr-11761-52bb0d56110510df28ff1d4ca698cf08cfeacf8c created (now 0b9f4f5a59)

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

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/dev/pr-11761-52bb0d56110510df28ff1d4ca698cf08cfeacf8c
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


      at 0b9f4f5a59 [Docs][Connector-V2] Improve Jdbc LocalFile SftpFile SqlServer-CDC and Opengauss-CDC connector docs (#11761)

This branch includes the following new commits:

     new 0b9f4f5a59 [Docs][Connector-V2] Improve Jdbc LocalFile SftpFile SqlServer-CDC and Opengauss-CDC connector docs (#11761)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(seatunnel) 01/01: [Docs][Connector-V2] Improve Jdbc LocalFile SftpFile SqlServer-CDC and Opengauss-CDC connector docs (#11761)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/dev/pr-11761-52bb0d56110510df28ff1d4ca698cf08cfeacf8c
in repository https://gitbox.apache.org/repos/asf/seatunnel.git

commit 0b9f4f5a59e45d2e5d503317cb0b1c044b84634b
Author: Daniel Carter <80...@qq.com>
AuthorDate: Thu Sep 10 15:43:46 2026 +0000

    [Docs][Connector-V2] Improve Jdbc LocalFile SftpFile SqlServer-CDC and Opengauss-CDC connector docs (#11761)
    
    Co-authored-by: DanielCarter-stack <Da...@users.noreply.github.com>
    Co-authored-by: DanielCarter-stack <no...@danielcarter-stack.local>
---
 docs/en/connectors/sink/Jdbc.md            |  49 +++++++++++++
 docs/en/connectors/source/Jdbc.md          |  43 ++++++++++++
 docs/en/connectors/source/LocalFile.md     |  46 +++++++++++++
 docs/en/connectors/source/Opengauss-CDC.md |  26 ++++---
 docs/en/connectors/source/SftpFile.md      |  99 ++++++++++++++++++++++++++
 docs/en/connectors/source/SqlServer-CDC.md | 107 ++++++++++++++++++++++++++++-
 6 files changed, 358 insertions(+), 12 deletions(-)

diff --git a/docs/en/connectors/sink/Jdbc.md b/docs/en/connectors/sink/Jdbc.md
index 00172e891a..460091c300 100644
--- a/docs/en/connectors/sink/Jdbc.md
+++ b/docs/en/connectors/sink/Jdbc.md
@@ -846,6 +846,51 @@ sink {
 }
 ```
 
+#### SqlServer CDC source
+
+```hocon
+env {
+  parallelism = 1
+  job.mode = "STREAMING"
+  checkpoint.interval = 5000
+}
+
+source {
+  SqlServer-CDC {
+    plugin_output = "customers"
+    username = "sa"
+    password = "Password!"
+    database-names = ["column_type_test"]
+    table-names = [
+      "column_type_test.dbo.full_types",
+      "column_type_test.dbo.full_types_2"
+    ]
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=column_type_test"
+  }
+}
+
+sink {
+  Jdbc {
+    plugin_input = "customers"
+    driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=column_type_test;encrypt=false"
+    user = "sa"
+    password = "Password!"
+    generate_sink_sql = true
+    database = "column_type_test"
+    schema = "dbo"
+    table = "sink_${table_name}"
+    batch_size = 1
+    primary_keys = ["id"]
+  }
+}
+```
+
+The `${table_name}` placeholder in `table` is filled from the upstream record's table metadata so each source table
+(`full_types`, `full_types_2`) is written to its own sink table (`sink_full_types`, `sink_full_types_2`). Pair this with
+`generate_sink_sql = true` and a pre-existing `primary_keys` list so SeaTunnel can emit the right INSERT/UPSERT for each
+upstream table.
+
 #### Amazon Aurora DSQL
 
 ```hocon
@@ -894,6 +939,10 @@ sink {
 }
 ```
 
+`dialect = "Dsql"` selects Amazon Aurora DSQL. AWS credentials are read from `access_key_id` / `secret_access_key`
+(and `region`) rather than from a username/password pair. Aurora DSQL does not support XA, so leave
+`is_exactly_once` at its default of `false`.
+
 ## Troubleshooting
 
 ### Does JDBC Sink support automatic table creation?
diff --git a/docs/en/connectors/source/Jdbc.md b/docs/en/connectors/source/Jdbc.md
index c20c159316..3a89100647 100644
--- a/docs/en/connectors/source/Jdbc.md
+++ b/docs/en/connectors/source/Jdbc.md
@@ -138,6 +138,10 @@ Do not use MySQL Connector/J with a `jdbc:mysql:` URL for MariaDB. That configur
 - [x] [batch](../../introduction/concepts/connector-v2-features.md)
 - [ ] [stream](../../introduction/concepts/connector-v2-features.md)
 - [x] [exactly-once](../../introduction/concepts/connector-v2-features.md)
+
+JDBC Source is a bounded source. It completes the snapshot read once and finishes; use a CDC source connector when the
+job must continue capturing later inserts, updates, and deletes.
+
 - [x] [column projection](../../introduction/concepts/connector-v2-features.md)
 
 Use `query` to select only the required columns.
@@ -513,6 +517,45 @@ sink {
 }
 ```
 
+### Read with explicit partition column and partition query
+
+Use `partition_column` together with `query` to split a single-table read into parallel chunks. `partition_lower_bound`
+and `partition_upper_bound` are optional; omitting them triggers a `MIN`/`MAX` discovery query before the read starts.
+
+```hocon
+env {
+  parallelism = 4
+  job.mode = "BATCH"
+}
+
+source {
+  Jdbc {
+    url = "jdbc:postgresql://postgresql.example.com:5432/sales?loggerLevel=OFF"
+    driver = "org.postgresql.Driver"
+    username = "seatunnel_reader"
+    password = "change_me"
+    query = """select gid, uuid_col, text_col, varchar_col, char_one_col, char_col, boolean_col, smallint_col, integer_col,
+                      bigint_col, decimal_col, numeric_col, real_col, double_precision_col, smallserial_col, serial_col,
+                      bigserial_col, date_col, timestamp_col, timestamp_tz_col, bpchar_col, age, name from pg_e2e_source_table"""
+    partition_column = "gid"
+    partition_num = 4
+  }
+}
+
+sink {
+  Jdbc {
+    url = "jdbc:postgresql://postgresql.example.com:5432/sales?loggerLevel=OFF&stringtype=unspecified"
+    driver = "org.postgresql.Driver"
+    username = "writer"
+    password = "change_me"
+    generate_sink_sql = true
+    database = "sales"
+    table = "public.pg_e2e_sink_table"
+    primary_keys = ["gid"]
+  }
+}
+```
+
 ## Troubleshooting
 
 ### JDBC driver class cannot be found
diff --git a/docs/en/connectors/source/LocalFile.md b/docs/en/connectors/source/LocalFile.md
index 0d5e3efb3f..ce2c3cf10d 100644
--- a/docs/en/connectors/source/LocalFile.md
+++ b/docs/en/connectors/source/LocalFile.md
@@ -738,10 +738,15 @@ LocalFile {
       path = "/apps/hive/demo/teacher"
       file_format_type = "json"
     }
+  ]
 }
 
 ```
 
+Each entry under `tables_configs` is treated as an independent logical table: it has its own `path`,
+`file_format_type`, and inline `schema`. This is the recommended layout when each input folder uses a different
+format or a different schema.
+
 ### Read PDF File
 
 ```hocon
@@ -767,6 +772,47 @@ sink {
 
 For best results, use PDF files that contain an outline (bookmarks/table of contents). This enables the parser to extract headings with hierarchy information.
 
+### Read JSON with structured schema
+
+When reading JSON, csv, text, excel or xml, declare an explicit schema so each row maps to a typed SeaTunnel row. The
+schema below is the same one used by the connector test suite and exercises every primitive SeaTunnel data type.
+
+```hocon
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  LocalFile {
+    path = "/seatunnel/read/json"
+    file_format_type = "json"
+    schema = {
+      fields {
+        c_map = "map<string, string>"
+        c_array = "array<int>"
+        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_bytes = bytes
+        c_date = date
+        c_decimal = "decimal(38, 18)"
+        c_timestamp = timestamp
+      }
+    }
+  }
+}
+
+sink {
+  Console {}
+}
+```
+
 ### Transfer Binary File
 
 ```hocon
diff --git a/docs/en/connectors/source/Opengauss-CDC.md b/docs/en/connectors/source/Opengauss-CDC.md
index e7f258d861..5381900c76 100644
--- a/docs/en/connectors/source/Opengauss-CDC.md
+++ b/docs/en/connectors/source/Opengauss-CDC.md
@@ -40,12 +40,16 @@ SELECT pg_reload_conf();
 ALTER TABLE your_table_name REPLICA IDENTITY FULL;
 ```
 
-If you have multi tables,you can use the result of this sql to change the REPLICA policy of all tables to FULL
+If you have multi tables, you can use the result of this sql to change the REPLICA policy of all tables to FULL
 
 ```sql
 select 'ALTER TABLE ' || schemaname || '.' || tablename || ' REPLICA IDENTITY FULL;' from pg_tables where schemaname = 'YourTableSchema'
 ```
 
+3. When `startup.mode = initial`, the connector reads the table snapshot before starting incremental streaming. The
+   snapshot phase runs in parallel using the same split rules as the streaming phase, and the incremental LSN is resumed
+   after the snapshot completes.
+
 ## Data Type Mapping
 
 |                                   Opengauss Data type                                   |                                                              SeaTunnel Data type                                                               |
@@ -72,7 +76,7 @@ select 'ALTER TABLE ' || schemaname || '.' || tablename || ' REPLICA IDENTITY FU
 | username                                  | String   | Yes      | -        | Username of the database to use when connecting to the database server.                                                                                                                                                                                                                                                                                                                                                       [...]
 | password                                  | String   | Yes      | -        | Password to use when connecting to the database server.                                                                                                                                                                                                                                                                                                                                                                       [...]
 | database-names                            | List     | No       | -        | Database names to monitor.                                                                                                                                                                                                                                                                                                                                                                                                    [...]
-| table-names                               | List     | Yes, if `table-pattern` is not used | -        | Tables to monitor. Use the fully qualified `database.schema.table` format, for example: `opengauss_cdc.inventory.orders`.                                                                                                                                                                                                                                                                          [...]
+| table-names                               | List     | Yes, if `table-pattern` is not used | -        | Tables to monitor. Use the fully qualified `database.schema.table` format, for example: `opengauss_cdc.inventory.orders`. Use `database.schema.table` matching to scope capture to a specific schema inside a database.                                                                                                                                                                            [...]
 | table-pattern                             | String   | Yes, if `table-names` is not used | -        | Regular expression for tables to monitor. Use the fully qualified table name in the pattern, for example: `opengauss_cdc\\.inventory\\..*`. `table-names` and `table-pattern` are mutually exclusive.                                                                                                                                                                                                [...]
 | table-names-config                        | List     | No       | -        | Per-table config list. Example: `[{"table": "db1.schema1.table1","primaryKeys": ["key1"],"snapshotSplitColumn": "key2"}]`. Use `primaryKeys` for tables without a physical primary key. `snapshotSplitColumn` must be a unique key; otherwise SeaTunnel ignores it and selects a split column internally.                                                                                                                     [...]
 | startup.mode                              | Enum     | No       | INITIAL  | Optional startup mode for Opengauss CDC consumer, valid enumerations are `initial`, `snapshot-only`, `committed-offset`, `earliest` and `latest`. <br/> `initial`: Synchronize historical data at startup, and then synchronize incremental data.<br/> `snapshot-only`: Synchronize historical data at startup and finish as a bounded job without entering WAL streaming.<br/> `committed-offset`: Skip snapshot data and st [...]
@@ -101,15 +105,14 @@ select 'ALTER TABLE ' || schemaname || '.' || tablename || ' REPLICA IDENTITY FU
 
 > Support multi-table reading
 
-```
-
+```hocon
 env {
   # You can set engine configuration here
   execution.parallelism = 1
   job.mode = "STREAMING"
   checkpoint.interval = 5000
-  read_limit.bytes_per_second=7000000
-  read_limit.rows_per_second=400
+  read_limit.bytes_per_second = 7000000
+  read_limit.rows_per_second = 400
 }
 
 source {
@@ -118,7 +121,7 @@ source {
     username = "gaussdb"
     password = "openGauss@123"
     database-names = ["opengauss_cdc"]
-    table-names = ["opengauss_cdc.inventory.opengauss_cdc_table_1","opengauss_cdc.inventory.opengauss_cdc_table_2"]
+    table-names = ["opengauss_cdc.inventory.opengauss_cdc_table_1", "opengauss_cdc.inventory.opengauss_cdc_table_2"]
     url = "jdbc:postgresql://opengauss_cdc_e2e:5432/opengauss_cdc"
     decoding.plugin.name = "pgoutput"
     slot.name = "seatunnel_opengauss_cdc"
@@ -126,7 +129,6 @@ source {
 }
 
 transform {
-
 }
 
 sink {
@@ -137,7 +139,7 @@ sink {
     username = "dailai"
     password = "openGauss@123"
 
-    compatible_mode="postgresLow"
+    compatible_mode = "postgresLow"
     generate_sink_sql = true
     # You need to configure both database and table
     database = "opengauss_cdc"
@@ -146,12 +148,14 @@ sink {
     primary_keys = ["id"]
   }
 }
-
 ```
 
 ### Support custom primary key for table
 
-```
+When the upstream table has no usable primary key, declare it with `table-names-config` and supply an explicit
+`primaryKeys` list. The connector uses these keys for CDC ordering and for the snapshot split.
+
+```hocon
 source {
   Opengauss-CDC {
     plugin_output = "customers_opengauss_cdc"
diff --git a/docs/en/connectors/source/SftpFile.md b/docs/en/connectors/source/SftpFile.md
index cef852f3a7..4c087e9e99 100644
--- a/docs/en/connectors/source/SftpFile.md
+++ b/docs/en/connectors/source/SftpFile.md
@@ -32,6 +32,10 @@ import ChangeLog from '../changelog/connector-file-sftp.md';
   - [x] markdown
   - [x] pdf
 
+SftpFile is a bounded source. When `discovery_mode = once` (the default) the connector enumerates files once and
+finishes; use `discovery_mode = continuous` together with `sync_mode = update` to keep the job running and stream
+new/changed files into the sink.
+
 ## Description
 
 Read data from sftp file server.
@@ -560,6 +564,101 @@ sink {
   }
 }
 ```
+
+### Recursive scan over text files
+
+Set `recursive_file_scan = true` to enumerate files in subdirectories of `path`. The example below reads text files
+under a nested directory and uses an explicit schema so each row maps to typed SeaTunnel columns.
+
+```hocon
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  SftpFile {
+    host = "sftp"
+    port = 22
+    user = seatunnel
+    password = pass
+    path = "tmp/seatunnel/read/recursive"
+    file_format_type = "text"
+    recursive_file_scan = true
+    plugin_output = "sftp"
+    schema = {
+      fields {
+        c_map = "map<string, string>"
+        c_array = "array<int>"
+        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_bytes = bytes
+        c_date = date
+        c_decimal = "decimal(38, 18)"
+        c_timestamp = timestamp
+      }
+    }
+  }
+}
+
+sink {
+  Assert {
+    plugin_input = "sftp"
+    rules {
+      row_rules = [
+        { rule_type = MAX_ROW, rule_value = 20 },
+        { rule_type = MIN_ROW, rule_value = 20 }
+      ]
+    }
+  }
+}
+```
+
+### Public key authentication
+
+When the SFTP server is configured for SSH key authentication, supply the private key path through `keyfile` and omit
+`password`. The connector uses the JSCH library internally, so `keyfile` follows the OpenSSH private-key format and
+must be readable by the engine process.
+
+```hocon
+env {
+  parallelism = 1
+  job.mode = "BATCH"
+}
+
+source {
+  SftpFile {
+    host = "sftp.example.com"
+    port = 22
+    user = "seatunnel"
+    keyfile = "/opt/seatunnel/keys/sftp_id_rsa"
+    path = "data/incoming/"
+    file_format_type = "csv"
+    plugin_output = "sftp"
+    schema = {
+      fields {
+        id = bigint
+        name = string
+      }
+    }
+  }
+}
+
+sink {
+  Console {}
+}
+```
+
+`password` and `keyfile` are both loaded into the SSH session when configured. The connector uses the JSCH library,
+whose default authentication order tries `publickey` (via `keyfile`) before `password`. To avoid surprises during
+authentication failures, prefer setting only one of them. The engine process must have permission to read `keyfile`;
+if the key file is passphrase-protected, configure the SSH agent or decrypt it before the job starts.
 ### Multiple Table
 
 ```hocon
diff --git a/docs/en/connectors/source/SqlServer-CDC.md b/docs/en/connectors/source/SqlServer-CDC.md
index 9819dac8e7..40ca9315dd 100644
--- a/docs/en/connectors/source/SqlServer-CDC.md
+++ b/docs/en/connectors/source/SqlServer-CDC.md
@@ -27,6 +27,10 @@ import ChangeLog from '../changelog/connector-cdc-sqlserver.md';
 The Sql Server CDC connector allows for reading snapshot data and incremental data from SqlServer database. This document
 describes how to setup the Sql Server CDC connector to run SQL queries against SqlServer databases.
 
+When `startup.mode = initial`, the connector first reads the snapshot of each monitored table using parallel splits,
+then switches to incremental streaming from the LSN recorded at the end of the snapshot. Downstream consumers should
+treat the snapshot phase as a one-time bootstrap and not rely on it for steady-state reads.
+
 :::tip
 
 When discovering table columns via JDBC metadata, SeaTunnel filters metadata rows by the exact schema/table identifier to
@@ -317,12 +321,72 @@ source {
 }
 ```
 
+### Heartbeat action
+
+Use the `debezium.heartbeat.action.query` option to keep the CDC slot active when there are no upstream changes for a
+long time. Pair it with `debezium.heartbeat.interval.ms` so the action runs at a regular cadence.
+
+```hocon
+source {
+  SqlServer-CDC {
+    plugin_output = "customers"
+    username = "sa"
+    password = "Password!"
+    database-names = ["column_type_test"]
+    table-names = ["column_type_test.dbo.full_types"]
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=column_type_test"
+    debezium {
+      heartbeat.interval.ms = 100
+      heartbeat.action.query = "INSERT INTO column_type_test.dbo.heartbeat (ts) VALUES (GETDATE())"
+    }
+  }
+}
+```
+
+The heartbeat table and insert statement must exist on the target database. Without a heartbeat, the LSN window may be
+recycled by SQL Server when there is no activity, which can break resumable streaming jobs.
+
 ### Schema change event filtering
 
 When `schema-changes.enabled = true`, you can further control which schema change event types are
 propagated downstream using `schema-changes.include` / `schema-changes.exclude`.
 
-Use these SeaTunnel-owned canonical names:
+```hocon
+env {
+  parallelism = 1
+  job.mode = "STREAMING"
+  checkpoint.interval = 5000
+}
+
+source {
+  SqlServer-CDC {
+    plugin_output = "products"
+    username = "sa"
+    password = "Password!"
+    database-names = ["schema_change_test"]
+    table-names = ["schema_change_test.dbo.products"]
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=schema_change_test"
+    schema-changes.enabled = true
+  }
+}
+
+sink {
+  Jdbc {
+    plugin_input = "products"
+    driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=schema_change_test;encrypt=false"
+    user = "sa"
+    password = "Password!"
+    generate_sink_sql = true
+    database = "schema_change_test"
+    table = "dbo.products_sink"
+    batch_size = 1
+    primary_keys = ["id"]
+  }
+}
+```
+
+Use these SeaTunnel-owned canonical names to filter schema events:
 
 | Canonical name   | Operation                                            |
 |------------------|------------------------------------------------------|
@@ -353,6 +417,47 @@ source {
 by the sink, so excluding `drop.column` for a NOT NULL column that the source has stopped supplying
 will fail at the sink.
 
+### Databases with special characters in the name
+
+The `database-names` list and the `databaseName` parameter in the JDBC URL must use the exact identifier as stored on
+the server. When the database name contains characters such as `-` or `.`, quote the database name in SQL but quote
+the URL parameter literally. The connector does not URL-encode the database name automatically.
+
+```hocon
+env {
+  parallelism = 1
+  job.mode = "STREAMING"
+  checkpoint.interval = 5000
+}
+
+source {
+  SqlServer-CDC {
+    plugin_output = "customers"
+    username = "sa"
+    password = "Password!"
+    database-names = ["test-db-name"]
+    table-names = ["test-db-name.dbo.simple_table"]
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=test-db-name"
+    exactly_once = false
+  }
+}
+
+sink {
+  Jdbc {
+    plugin_input = "customers"
+    driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    url = "jdbc:sqlserver://sqlserver-host:1433;databaseName=test-db-name;encrypt=false"
+    user = "sa"
+    password = "Password!"
+    generate_sink_sql = true
+    database = "test-db-name"
+    table = "dbo.simple_table_sink"
+    batch_size = 1
+    primary_keys = ["id"]
+  }
+}
+```
+
 ## Changelog
 
 <ChangeLog />