pingcap / pingcap/tidb

tidb lightning: distinguish certain type of Empty string value and NULL value

Open
#49,596 1 comment 0 reactions 0 assignees View on GitHub
component/lightning type/new-feature
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
Now I have got a csv data file like below, which use comma ',' as separator and double quotation marks '"' as delimiter :
10000,"NAME1","REMARK1"
10001,,"REMARK2"
10003,"","REMARK3"

tidb table definition is : create table NTEST(id bigint primary key, name varchar(32), remark varchar(128));

mydumper.csv in lightning config like this:
[mydumper.csv]
separator = ','
delimiter = '"'
terminator = ""
header = false
not-null = false
null = ''
backslash-escape = true

### 2. What did you expect to see? (Required)
![image](https://github.com/pingcap/tidb/assets/31024228/f225fff4-6eb6-4e43-9fc3-7bcc961dd353)

### 3. What did you see instead (Required)
After finished data load, data in tidb can not distinguish NULL value and Empty value.
![image](https://github.com/pingcap/tidb/assets/31024228/3461636d-135a-44cb-836c-6b8870c776a6)
### 4. What is your TiDB version? (Required)

Release Version: v7.1.2
Edition: Enterprise
Git Commit Hash: aa6ed99ae63191bc98e883fd4c369ae7482cccb7
Git Branch: heads/refs/tags/v7.1.2
UTC Build Time: 2023-10-21 07:37:42
GoVersion: go1.20.10
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
Enterprise Extension Commit Hash: f26e979cbfd7af84b5b6dd54741057989bf6e473 |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.