MCPcopy Create free account
hub / github.com/apecloud/myduckserver / buildLoadData

Method buildLoadData

backend/loaddata.go:58–63  ·  view source on GitHub ↗

buildLoadData translates a MySQL LOAD DATA statement into a DuckDB INSERT INTO statement and executes it.

(ctx *sql.Context, root sql.Node, insert *plan.InsertInto, dst sql.InsertableTable, load *plan.LoadData)

Source from the content-addressed store, hash-verified

56// buildLoadData translates a MySQL LOAD DATA statement
57// into a DuckDB INSERT INTO statement and executes it.
58func (db *DuckBuilder) buildLoadData(ctx *sql.Context, root sql.Node, insert *plan.InsertInto, dst sql.InsertableTable, load *plan.LoadData) (sql.RowIter, error) {
59 if load.Local {
60 return db.buildClientSideLoadData(ctx, insert, dst, load)
61 }
62 return db.buildServerSideLoadData(ctx, insert, dst, load)
63}
64
65// Since the data is sent to the server in the form of a byte stream,
66// we use a Unix pipe to stream the data to DuckDB.

Callers 1

BuildMethod · 0.95

Calls 2

Tested by

no test coverage detected