MCPcopy
hub / github.com/pingcap/tidb / WriteInsert

Method WriteInsert

dumpling/export/writer_util.go:657–673  ·  view source on GitHub ↗

WriteInsert writes TableDataIR to a storage.ExternalFileWriter in sql/csv type

(
	pCtx *tcontext.Context,
	cfg *Config,
	meta TableMeta,
	tblIR TableDataIR,
	w storage.ExternalFileWriter,
	metrics *metrics,
)

Source from the content-addressed store, hash-verified

655
656// WriteInsert writes TableDataIR to a storage.ExternalFileWriter in sql/csv type
657func (f FileFormat) WriteInsert(
658 pCtx *tcontext.Context,
659 cfg *Config,
660 meta TableMeta,
661 tblIR TableDataIR,
662 w storage.ExternalFileWriter,
663 metrics *metrics,
664) (uint64, error) {
665 switch f {
666 case FileFormatSQLText:
667 return WriteInsert(pCtx, cfg, meta, tblIR, w, metrics)
668 case FileFormatCSV:
669 return WriteInsertInCsv(pCtx, cfg, meta, tblIR, w, metrics)
670 default:
671 return 0, errors.Errorf("unknown file format")
672 }
673}

Callers 1

tryToWriteTableDataMethod · 0.80

Calls 3

WriteInsertFunction · 0.85
WriteInsertInCsvFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected