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

Method sqlValues

compiler/semantic/sql.go:330–340  ·  view source on GitHub ↗

sqlValues analyzes the values expression which currently cannot depend on the input data (until we add support for lateral joins; then a values clause in the FROM can refer to the left relation).

(values *ast.SQLValues, seq sem.Seq)

Source from the content-addressed store, hash-verified

328// on the input data (until we add support for lateral joins; then a values
329// clause in the FROM can refer to the left relation).
330func (t *translator) sqlValues(values *ast.SQLValues, seq sem.Seq) (sem.Seq, *staticTable) {
331 exprs := make([]sem.Expr, 0, len(values.Exprs))
332 types := make([]super.Type, 0, len(values.Exprs))
333 for _, astExpr := range values.Exprs {
334 e, typ := t.expr(astExpr, super.TypeNull)
335 exprs = append(exprs, e)
336 types = append(types, typ)
337 }
338 seq = append(seq, sem.NewValues(values, exprs...))
339 return seq, t.inferSchema(values, types)
340}
341
342// With type checking integrated into the SQL analysis, the logic here
343// can always infer a staticTable. Eventually, this will need to support

Callers 1

sqlQueryBodyMethod · 0.95

Calls 3

exprMethod · 0.95
inferSchemaMethod · 0.95
NewValuesFunction · 0.92

Tested by

no test coverage detected