From 1a2e39c83a778f44c1c762df9c61a33f7a59c679 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Thu, 17 Jul 2025 13:38:44 +0800 Subject: [PATCH 1/5] Add temp.md --- temp.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp.md diff --git a/temp.md b/temp.md new file mode 100644 index 0000000000000..af27ff4986a7b --- /dev/null +++ b/temp.md @@ -0,0 +1 @@ +This is a test file. \ No newline at end of file From 91267f792a5ec7e259bccf8ccd7942adbc396e3a Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Thu, 17 Jul 2025 13:38:47 +0800 Subject: [PATCH 2/5] Delete temp.md --- temp.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp.md diff --git a/temp.md b/temp.md deleted file mode 100644 index af27ff4986a7b..0000000000000 --- a/temp.md +++ /dev/null @@ -1 +0,0 @@ -This is a test file. \ No newline at end of file From 8d067c0fb911bf892ad96a71f39d1af89aa1be85 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 17 Jul 2025 13:46:49 +0800 Subject: [PATCH 3/5] Update ticdc-csv.md --- ticdc/ticdc-csv.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ticdc/ticdc-csv.md b/ticdc/ticdc-csv.md index 40d6de9161fb8..b8fd562bff82d 100644 --- a/ticdc/ticdc-csv.md +++ b/ticdc/ticdc-csv.md @@ -28,6 +28,7 @@ quote = '"' null = '\N' include-commit-ts = true output-old-value = false +output-field-header = false ``` ## Transactional constraints @@ -51,6 +52,12 @@ In the CSV file, each column is defined as follows: - Column 5: The `is-update` column only exists when the value of `output-old-value` is true, which is used to identify whether the row data change comes from the UPDATE event (the value of the column is true) or the INSERT/DELETE event (the value is false). - Column 6 to the last column: One or more columns with data changes. +When `output-field-header = true`, the CSV file includes a header row. The column names in the header row are as follows: + +| Column 1 | Column 2 | Column 3 | Column 4 (optional) | Column 5 (optional) | Column 6 | ... | Last column | +| --- | --- | --- | --- | --- | --- | --- | --- | +| `ticdc-meta$operation` | `ticdc-meta$table` | `ticdc-meta$schema` | `ticdc-meta$commit-ts` | `ticdc-meta$is-update` | The first column with data changes | ... | The last column with data changes | + Assume that table `hr.employee` is defined as follows: ```sql @@ -85,6 +92,19 @@ When `include-commit-ts = true` and `output-old-value = true`, the DML events of "I","employee","hr",433305438660591630,true,102,"Alex","Alice","2018-06-15","Beijing" ``` +When `include-commit-ts = true`, `output-old-value = true`, and `output-field-header = true`, the DML events of this table are stored in the CSV format as follows: + +``` +ticdc-meta$operation,ticdc-meta$table,ticdc-meta$schema,ticdc-meta$commit-ts,ticdc-meta$is-update,Id,LastName,FirstName,HireDate,OfficeLocation +"I","employee","hr",433305438660591626,false,101,"Smith","Bob","2014-06-04","New York" +"D","employee","hr",433305438660591627,true,101,"Smith","Bob","2015-10-08","Shanghai" +"I","employee","hr",433305438660591627,true,101,"Smith","Bob","2015-10-08","Los Angeles" +"D","employee","hr",433305438660591629,false,101,"Smith","Bob","2017-03-13","Dallas" +"I","employee","hr",433305438660591630,false,102,"Alex","Alice","2017-03-14","Shanghai" +"D","employee","hr",433305438660591630,true,102,"Alex","Alice","2017-03-14","Beijing" +"I","employee","hr",433305438660591630,true,102,"Alex","Alice","2018-06-15","Beijing" +``` + ## Data type mapping | MySQL type | CSV type | Example | Description | From c94598507c6ae48156644f78b340db4012b8fedf Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 23 Jul 2025 14:15:53 +0800 Subject: [PATCH 4/5] Update ticdc/ticdc-csv.md --- ticdc/ticdc-csv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ticdc/ticdc-csv.md b/ticdc/ticdc-csv.md index b8fd562bff82d..a65e9392f179b 100644 --- a/ticdc/ticdc-csv.md +++ b/ticdc/ticdc-csv.md @@ -28,7 +28,7 @@ quote = '"' null = '\N' include-commit-ts = true output-old-value = false -output-field-header = false +output-field-header = false # New in v9.0.0 ``` ## Transactional constraints From 8615c48ea32c75e21e69fc433873dc52f6668c69 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 12 Aug 2025 14:02:51 +0800 Subject: [PATCH 5/5] Update ticdc/ticdc-csv.md Co-authored-by: Aolin --- ticdc/ticdc-csv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ticdc/ticdc-csv.md b/ticdc/ticdc-csv.md index a65e9392f179b..8bd85763b187d 100644 --- a/ticdc/ticdc-csv.md +++ b/ticdc/ticdc-csv.md @@ -94,7 +94,7 @@ When `include-commit-ts = true` and `output-old-value = true`, the DML events of When `include-commit-ts = true`, `output-old-value = true`, and `output-field-header = true`, the DML events of this table are stored in the CSV format as follows: -``` +```csv ticdc-meta$operation,ticdc-meta$table,ticdc-meta$schema,ticdc-meta$commit-ts,ticdc-meta$is-update,Id,LastName,FirstName,HireDate,OfficeLocation "I","employee","hr",433305438660591626,false,101,"Smith","Bob","2014-06-04","New York" "D","employee","hr",433305438660591627,true,101,"Smith","Bob","2015-10-08","Shanghai"