MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Type

Method Type

server/expression/array_flatten.go:49–61  ·  view source on GitHub ↗

Type implements sql.Expression.

(ctx *sql.Context)

Source from the content-addressed store, hash-verified

47
48// Type implements sql.Expression.
49func (a ArrayFlatten) Type(ctx *sql.Context) sql.Type {
50 sqType := a.Subquery.Type(ctx)
51 dt, ok := sqType.(*types.DoltgresType)
52 if !ok {
53 // If we don't have a doltgres type, we'll error out at execution time. A special case is the tuple type,
54 // where we need to choose a single one to avoid erroring out too early.
55 if tt, ok := sqType.(gmstypes.TupleType); ok {
56 return tt[0]
57 }
58 return sqType
59 }
60 return dt.ToArrayType()
61}
62
63// IsNullable implements sql.Expression.
64func (a ArrayFlatten) IsNullable(ctx *sql.Context) bool {

Callers

nothing calls this directly

Calls 2

ToArrayTypeMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected