From 624ecc4686722f9657a95553fd4a46ad0b62d3a3 Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:48:03 +0800 Subject: [PATCH 1/7] Update tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 4ccc7764c2c6d..b078d94c1a880 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -234,8 +234,14 @@ delimiter = '"' # Line terminator. Empty value means both "\n" (LF) and "\r\n" (CRLF) are line terminators. terminator = '' # Whether the CSV files contain a header. -# If `header` is true, the first line will be skipped. +# If `header` is true, TiDB Lightning treats the first row as a table header and will not import it as data. If `header` is false, the first row is also imported as CSV data. header = true +# Whether the CSV table header matches the table structure of the target table. +# The default value is true, which means that when importing data, TiDB Lightning matches the column name of the CSV table header with the corresponding column of the target table. Even if the order of the columns in the CSV file and the target table is inconsistent, the data can still be imported. +# If set to false, it means that the column names in the CSV header and the target table are not matched. Some column names in the CSV header do not have a corresponding column with the same name in the target table. +# In this case, when importing data, TiDB Lightning will ignore the content of the CSV header to avoid errors. The CSV data is directly imported in the order of the target table columns. +# Note: This parameter only takes effect when header = true. If header = false, it means that the CSV file does not have a header. In this case, there is no need to consider the matching of column names. +header-schema-match = true # Whether the CSV contains any NULL value. # If `not-null` is true, all columns from CSV cannot be NULL. not-null = false From c43652784ec75a50dac71420861e75c8051f520b Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:55:57 +0800 Subject: [PATCH 2/7] Update tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index b078d94c1a880..8896451fb547e 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -236,10 +236,10 @@ terminator = '' # Whether the CSV files contain a header. # If `header` is true, TiDB Lightning treats the first row as a table header and will not import it as data. If `header` is false, the first row is also imported as CSV data. header = true -# Whether the CSV table header matches the table structure of the target table. +# Whether the CSV table header matches the structure of the target table. # The default value is true, which means that when importing data, TiDB Lightning matches the column name of the CSV table header with the corresponding column of the target table. Even if the order of the columns in the CSV file and the target table is inconsistent, the data can still be imported. -# If set to false, it means that the column names in the CSV header and the target table are not matched. Some column names in the CSV header do not have a corresponding column with the same name in the target table. -# In this case, when importing data, TiDB Lightning will ignore the content of the CSV header to avoid errors. The CSV data is directly imported in the order of the target table columns. +# If it is set to false, it means that the column names in the CSV table header and the target table are not matched. Some column names in the CSV table header do not have corresponding columns with the same name in the target table. +# In this case, when importing data, TiDB Lightning will ignore the CSV header to avoid errors. The CSV data is directly imported in the order of the columns in the target table. # Note: This parameter only takes effect when header = true. If header = false, it means that the CSV file does not have a header. In this case, there is no need to consider the matching of column names. header-schema-match = true # Whether the CSV contains any NULL value. From ff9d332ae9ed44b2f6961d855b601e208b3c4daf Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Thu, 9 Feb 2023 13:25:56 +0800 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: dsdashun --- tidb-lightning/tidb-lightning-configuration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 8896451fb547e..819e91d5f0ddc 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -234,13 +234,13 @@ delimiter = '"' # Line terminator. Empty value means both "\n" (LF) and "\r\n" (CRLF) are line terminators. terminator = '' # Whether the CSV files contain a header. -# If `header` is true, TiDB Lightning treats the first row as a table header and will not import it as data. If `header` is false, the first row is also imported as CSV data. +# If `header` is true, TiDB Lightning treats the first row as a table header and does not import it as data. If `header` is false, the first row is also imported as CSV data. header = true -# Whether the CSV table header matches the structure of the target table. -# The default value is true, which means that when importing data, TiDB Lightning matches the column name of the CSV table header with the corresponding column of the target table. Even if the order of the columns in the CSV file and the target table is inconsistent, the data can still be imported. -# If it is set to false, it means that the column names in the CSV table header and the target table are not matched. Some column names in the CSV table header do not have corresponding columns with the same name in the target table. -# In this case, when importing data, TiDB Lightning will ignore the CSV header to avoid errors. The CSV data is directly imported in the order of the columns in the target table. -# Note: This parameter only takes effect when header = true. If header = false, it means that the CSV file does not have a header. In this case, there is no need to consider the matching of column names. +# Whether the columns in the CSV file header are matched to those defined in the target table. +# The default value is set to "true", which means that TiDB Lightning will match the column names in the CSV header with those in the target table, so that even if the order of the columns is different between the two, the data can still be imported successfully. +# If it is set to "false", it indicates that the columns in the CSV header might not have exact matches in the target table. For example, some columns in the CSV header might be missing in the target table. +# In this scenario, TiDB Lightning will ignore the CSV header to avoid errors and import the data directly in the order of the columns in the target table. +# It's important to note that this parameter only applies if the `header` parameter is set to "true". If `header` is set to "false", it means that the CSV file does not contain a header, so this parameter is not relevant. header-schema-match = true # Whether the CSV contains any NULL value. # If `not-null` is true, all columns from CSV cannot be NULL. From 7acf54e8dddb217aae34596b613cd2d27ec615ff Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 10 Feb 2023 08:58:48 +0800 Subject: [PATCH 4/7] Update tidb-lightning/tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 819e91d5f0ddc..70287690e5698 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -238,7 +238,7 @@ terminator = '' header = true # Whether the columns in the CSV file header are matched to those defined in the target table. # The default value is set to "true", which means that TiDB Lightning will match the column names in the CSV header with those in the target table, so that even if the order of the columns is different between the two, the data can still be imported successfully. -# If it is set to "false", it indicates that the columns in the CSV header might not have exact matches in the target table. For example, some columns in the CSV header might be missing in the target table. +# If the field names in the CSV table header and the column names in the target table do not match (for example, some field names in the CSV table header might not find a corresponding equivalent in the target table) but the column order is the same, set this configuration to false. # In this scenario, TiDB Lightning will ignore the CSV header to avoid errors and import the data directly in the order of the columns in the target table. # It's important to note that this parameter only applies if the `header` parameter is set to "true". If `header` is set to "false", it means that the CSV file does not contain a header, so this parameter is not relevant. header-schema-match = true From d6b8f8a675f7455b6058fbc786a74e00404321ff Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:11:55 +0800 Subject: [PATCH 5/7] Update tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index 70287690e5698..afe8e6fb51e50 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -237,9 +237,10 @@ terminator = '' # If `header` is true, TiDB Lightning treats the first row as a table header and does not import it as data. If `header` is false, the first row is also imported as CSV data. header = true # Whether the columns in the CSV file header are matched to those defined in the target table. -# The default value is set to "true", which means that TiDB Lightning will match the column names in the CSV header with those in the target table, so that even if the order of the columns is different between the two, the data can still be imported successfully. +# The default value is set to "true", which means that you have confirmed that the column names in the CSV header with those in the target table are consistent, so that even if the order of the columns is different between the two, TiDB Lightning can still import the data successfully. # If the field names in the CSV table header and the column names in the target table do not match (for example, some field names in the CSV table header might not find a corresponding equivalent in the target table) but the column order is the same, set this configuration to false. # In this scenario, TiDB Lightning will ignore the CSV header to avoid errors and import the data directly in the order of the columns in the target table. +# Therefore, if the columns are not in the same order, you need to manually adjust the order to be consistent before importing; otherwise data discrepancies might occur. # It's important to note that this parameter only applies if the `header` parameter is set to "true". If `header` is set to "false", it means that the CSV file does not contain a header, so this parameter is not relevant. header-schema-match = true # Whether the CSV contains any NULL value. From 40fbef60d8a9071ec39abd32337ac22fbec3b46e Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 10 Feb 2023 16:32:57 +0800 Subject: [PATCH 6/7] Update tidb-lightning/tidb-lightning-configuration.md --- tidb-lightning/tidb-lightning-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index afe8e6fb51e50..e62d1edbb8f95 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -240,7 +240,7 @@ header = true # The default value is set to "true", which means that you have confirmed that the column names in the CSV header with those in the target table are consistent, so that even if the order of the columns is different between the two, TiDB Lightning can still import the data successfully. # If the field names in the CSV table header and the column names in the target table do not match (for example, some field names in the CSV table header might not find a corresponding equivalent in the target table) but the column order is the same, set this configuration to false. # In this scenario, TiDB Lightning will ignore the CSV header to avoid errors and import the data directly in the order of the columns in the target table. -# Therefore, if the columns are not in the same order, you need to manually adjust the order to be consistent before importing; otherwise data discrepancies might occur. +# Therefore, if the columns are not in the same order, you need to manually adjust the order of the fields in the CSV file to be consistent with that in the target table before importing; otherwise data discrepancies might occur. # It's important to note that this parameter only applies if the `header` parameter is set to "true". If `header` is set to "false", it means that the CSV file does not contain a header, so this parameter is not relevant. header-schema-match = true # Whether the CSV contains any NULL value. From cab2816934133da72f6ce41c5e7d07390cce7e03 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Sun, 12 Feb 2023 10:17:04 +0800 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Grace Cai --- tidb-lightning/tidb-lightning-configuration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tidb-lightning/tidb-lightning-configuration.md b/tidb-lightning/tidb-lightning-configuration.md index e62d1edbb8f95..d7ff6f19d81ec 100644 --- a/tidb-lightning/tidb-lightning-configuration.md +++ b/tidb-lightning/tidb-lightning-configuration.md @@ -236,12 +236,12 @@ terminator = '' # Whether the CSV files contain a header. # If `header` is true, TiDB Lightning treats the first row as a table header and does not import it as data. If `header` is false, the first row is also imported as CSV data. header = true -# Whether the columns in the CSV file header are matched to those defined in the target table. -# The default value is set to "true", which means that you have confirmed that the column names in the CSV header with those in the target table are consistent, so that even if the order of the columns is different between the two, TiDB Lightning can still import the data successfully. -# If the field names in the CSV table header and the column names in the target table do not match (for example, some field names in the CSV table header might not find a corresponding equivalent in the target table) but the column order is the same, set this configuration to false. +# Whether the column names in the CSV file header are matched to those defined in the target table. +# The default value is `true`, which means that you have confirmed that the column names in the CSV header are consistent with those in the target table, so that even if the order of the columns is different between the two, TiDB Lightning can still import the data successfully by mapping the column names. +# If the column names between the CSV table header and the target table do not match (for example, some column names in the CSV table header cannot be found in the target table) but the column order is the same, set this configuration to `false`. # In this scenario, TiDB Lightning will ignore the CSV header to avoid errors and import the data directly in the order of the columns in the target table. -# Therefore, if the columns are not in the same order, you need to manually adjust the order of the fields in the CSV file to be consistent with that in the target table before importing; otherwise data discrepancies might occur. -# It's important to note that this parameter only applies if the `header` parameter is set to "true". If `header` is set to "false", it means that the CSV file does not contain a header, so this parameter is not relevant. +# Therefore, if the columns are not in the same order, you need to manually adjust the order of the columns in the CSV file to be consistent with that in the target table before importing; otherwise data discrepancies might occur. +# It is important to note that this parameter only applies if the `header` parameter is set to `true`. If `header` is set to `false`, it means that the CSV file does not contain a header, so this parameter is not relevant. header-schema-match = true # Whether the CSV contains any NULL value. # If `not-null` is true, all columns from CSV cannot be NULL.