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

Method CreatePipe

backend/pipe.go:12–25  ·  view source on GitHub ↗
(ctx *sql.Context, subdir string)

Source from the content-addressed store, hash-verified

10)
11
12func (h *DuckBuilder) CreatePipe(ctx *sql.Context, subdir string) (string, error) {
13 // Create the FIFO pipe
14 pipeDir := filepath.Join(h.provider.DataDir(), "pipes", subdir)
15 if err := os.MkdirAll(pipeDir, 0755); err != nil {
16 return "", err
17 }
18 pipeName := strconv.Itoa(int(ctx.ID())) + ".pipe"
19 pipePath := filepath.Join(pipeDir, pipeName)
20 ctx.GetLogger().Debugln("Creating FIFO pipe for LOAD/COPY operation:", pipePath)
21 if err := syscall.Mkfifo(pipePath, 0600); err != nil {
22 return "", err
23 }
24 return pipePath, nil
25}
26
27func RemoveAllPipes(dataDir string) error {
28 pipesDir := filepath.Join(dataDir, "pipes")

Callers 5

NewArrowWriterFunction · 0.80
NewArrowDataLoaderFunction · 0.80
NewCsvDataLoaderFunction · 0.80
NewDuckDataWriterFunction · 0.80

Calls 2

IDMethod · 0.80
DataDirMethod · 0.65

Tested by

no test coverage detected