Repository: pingcap/tidb
File: pkg/executor/importer/import.go (Go)

Code before:
	"github.com/pingcap/tidb/pkg/sessionctx/vardef"
	"github.com/pingcap/tidb/pkg/sessionctx/variable"
	"github.com/pingcap/tidb/pkg/table"
	tidbutil "github.com/pingcap/tidb/pkg/util"
	"github.com/pingcap/tidb/pkg/util/chunk"
	contextutil "github.com/pingcap/tidb/pkg/util/context"
	"github.com/pingcap/tidb/pkg/util/cpu"
	"github.com/pingcap/tidb/pkg/util/dbterror"
	"github.com/pingcap/tidb/pkg/util/dbterror/exeerrors"
	"github.com/pingcap/tidb/pkg/util/filter"
	"github.com/pingcap/tidb/pkg/util/logutil"
	"github.com/pingcap/tidb/pkg/util/stringutil"
	pd "github.com/tikv/pd/client"
	"go.uber.org/zap"
)

const (
	// DataFormatCSV represents the data source file of IMPORT INTO is csv.
	DataFormatCSV = "csv"
	// DataFormatDelimitedData delimited data.
	DataFormatDelimitedData = "delimited data"
	// DataFormatSQL represents the data source file of IMPORT INTO is mydumper-format DML file.
	DataFormatSQL = "sql"
	// DataFormatParquet represents the data source file of IMPORT INTO is parquet.
	DataFormatParquet = "parquet"
	// DataFormatAuto represents do not set format in IMPORT INTO stmt, will update when init data files.
	DataFormatAuto = "auto"

	// DefaultDiskQuota is the default disk quota for IMPORT INTO
	DefaultDiskQuota = config.ByteSize(50 << 30) // 50GiB

	// 0 means no limit
	unlimitedWriteSpeed = config.ByteSize(0)

	characterSetOption        = "character_set"
	fieldsTerminatedByOption  = "fields_terminated_by"
	fieldsEnclosedByOption    = "fields_enclosed_by"
	fieldsEscapedByOption     = "fields_escaped_by"
	fieldsDefinedNullByOption = "fields_defined_null_by"
	linesTerminatedByOption   = "lines_terminated_by"
	skipRowsOption            = "skip_rows"
	splitFileOption           = "split_file"
	diskQuotaOption           = "disk_quota"
	threadOption              = "thread"
	maxWriteSpeedOption       = "max_write_speed"
	checksumTableOption       = "checksum_table"
	recordErrorsOption        = "record_errors"
	detachedOption            = "detached"
	// if 'import mode' enabled, TiKV will:
	//  - set level0_stop_writes_trigger = max(old, 1 << 30)
	//  - set level0_slowdown_writes_trigger = max(old, 1 << 30)

Review comment (suggestion):
```suggestion
	// DataFormatAuto represents format is not set in IMPORT INTO, we will determine format automatically.
```

Code after:
	"github.com/pingcap/tidb/pkg/sessionctx/vardef"
	"github.com/pingcap/tidb/pkg/sessionctx/variable"
	"github.com/pingcap/tidb/pkg/table"
	tidbutil "github.com/pingcap/tidb/pkg/util"
	"github.com/pingcap/tidb/pkg/util/chunk"
	contextutil "github.com/pingcap/tidb/pkg/util/context"
	"github.com/pingcap/tidb/pkg/util/cpu"
	"github.com/pingcap/tidb/pkg/util/dbterror"
	"github.com/pingcap/tidb/pkg/util/dbterror/exeerrors"
	"github.com/pingcap/tidb/pkg/util/filter"
	"github.com/pingcap/tidb/pkg/util/logutil"
	"github.com/pingcap/tidb/pkg/util/stringutil"
	pd "github.com/tikv/pd/client"
	"go.uber.org/zap"
)

const (
	// DataFormatCSV represents the data source file of IMPORT INTO is csv.
	DataFormatCSV = "csv"
	// DataFormatDelimitedData delimited data.
	DataFormatDelimitedData = "delimited data"
	// DataFormatSQL represents the data source file of IMPORT INTO is mydumper-format DML file.
	DataFormatSQL = "sql"
	// DataFormatParquet represents the data source file of IMPORT INTO is parquet.
	DataFormatParquet = "parquet"
	// DataFormatAuto represents format is not set in IMPORT INTO, we will determine format automatically.
	DataFormatAuto = "auto"

	// DefaultDiskQuota is the default disk quota for IMPORT INTO
	DefaultDiskQuota = config.ByteSize(50 << 30) // 50GiB

	// 0 means no limit
	unlimitedWriteSpeed = config.ByteSize(0)

	characterSetOption        = "character_set"
	fieldsTerminatedByOption  = "fields_terminated_by"
	fieldsEnclosedByOption    = "fields_enclosed_by"
	fieldsEscapedByOption     = "fields_escaped_by"
	fieldsDefinedNullByOption = "fields_defined_null_by"
	linesTerminatedByOption   = "lines_terminated_by"
	skipRowsOption            = "skip_rows"
	splitFileOption           = "split_file"
	diskQuotaOption           = "disk_quota"
	threadOption              = "thread"
	maxWriteSpeedOption       = "max_write_speed"
	checksumTableOption       = "checksum_table"
	recordErrorsOption        = "record_errors"
	detachedOption            = "detached"
	// if 'import mode' enabled, TiKV will:
	//  - set level0_stop_writes_trigger = max(old, 1 << 30)
	//  - set level0_slowdown_writes_trigger = max(old, 1 << 30)