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

Method buildSQL

pgserver/arrowloader.go:60–81  ·  view source on GitHub ↗

buildSQL builds the DuckDB INSERT statement.

()

Source from the content-addressed store, hash-verified

58func (loader *ArrowDataLoader) buildSQL() string {
59 var b strings.Builder
60 b.Grow(256)
61
62 b.WriteString("INSERT INTO ")
63 if loader.schema != "" {
64 b.WriteString(loader.schema)
65 b.WriteString(".")
66 }
67 b.WriteString(loader.table.Name())
68
69 if len(loader.columns) > 0 {
70 b.WriteString(" (")
71 b.WriteString(loader.columns.String())
72 b.WriteString(")")
73 }
74
75 b.WriteString(" FROM ")
76 b.WriteString(loader.arrowName)
77
78 return b.String()
79}
80
81func (loader *ArrowDataLoader) executeInsert(sql string, pipePath string) {
82 defer close(loader.rowCount)
83
84 // Open the pipe for reading.

Callers 1

NewArrowDataLoaderFunction · 0.95

Calls 3

GrowMethod · 0.45
NameMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected