MCPcopy Create free account
hub / github.com/brimdata/super / sqlFromPipe

Method sqlFromPipe

compiler/semantic/sql.go:361–376  ·  view source on GitHub ↗
(pipe *ast.SQLPipe, seq sem.Seq)

Source from the content-addressed store, hash-verified

359}
360
361func (t *translator) sqlFromPipe(pipe *ast.SQLPipe, seq sem.Seq) (sem.Seq, relTable) {
362 if query, ok := maybeSQLQueryBody(pipe); ok {
363 seq, scope := t.sqlQueryBody(query, nil, seq, nil)
364 return scope.endScope(query, seq)
365 }
366 if len(seq) > 0 {
367 panic("semSQLOp: SQL pipes can't have parents")
368 }
369 // We pass in type null for initial type here since we know a pipe subquery inside
370 // of a sql table expression must always have a data source (i.e., it cannot inherit
371 // data from a parent node somewhere outside of this seq). XXX support for lateral
372 // join where the input to the pipe might depend on the table-expression to the left
373 // may change how we wire things up here.
374 seq, typ := t.seq(pipe.Body, super.TypeNull)
375 return seq, newTableFromType(typ, t.checker.unknown)
376}
377
378func maybeSQLQueryBody(pipe *ast.SQLPipe) (ast.SQLQueryBody, bool) {
379 if len(pipe.Body) == 1 {

Callers 1

sqlTableExprMethod · 0.95

Calls 5

sqlQueryBodyMethod · 0.95
seqMethod · 0.95
maybeSQLQueryBodyFunction · 0.85
newTableFromTypeFunction · 0.85
endScopeMethod · 0.65

Tested by

no test coverage detected