MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Overload

Struct Overload

pkg/sql/sem/tree/overload.go:43–76  ·  view source on GitHub ↗

Overload is one of the overloads of a built-in function. Each FunctionDefinition may contain one or more overloads.

Source from the content-addressed store, hash-verified

41// Overload is one of the overloads of a built-in function.
42// Each FunctionDefinition may contain one or more overloads.
43type Overload struct {
44 Types TypeList
45 ReturnType ReturnTyper
46
47 // PreferredOverload determines overload resolution as follows.
48 // When multiple overloads are eligible based on types even after all of of
49 // the heuristics to pick one have been used, if one of the overloads is a
50 // Overload with the `PreferredOverload` flag set to true it can be selected
51 // rather than returning a no-such-method error.
52 // This should generally be avoided -- avoiding introducing ambiguous
53 // overloads in the first place is a much better solution -- and only done
54 // after consultation with @knz @nvanbenschoten.
55 PreferredOverload bool
56
57 // Info is a description of the function, which is surfaced on the CockroachDB
58 // docs site on the "Functions and Operators" page. Descriptions typically use
59 // third-person with the function as an implicit subject (e.g. "Calculates
60 // infinity"), but should focus more on ease of understanding so other structures
61 // might be more appropriate.
62 Info string
63
64 AggregateFunc func([]*types.T, *EvalContext, Datums) AggregateFunc
65 WindowFunc func([]*types.T, *EvalContext) WindowFunc
66 Fn func(*EvalContext, Datums) (Datum, error)
67 //Generator GeneratorFactory
68
69 // counter, if non-nil, should be incremented upon successful
70 // type check of expressions using this overload.
71 //counter telemetry.Counter
72
73 // SpecializedVecBuiltin is used to let the vectorized engine
74 // know when an Overload has a specialized vectorized operator.
75 SpecializedVecBuiltin SpecializedVectorizedBuiltin
76}
77
78// params implements the overloadImpl interface.
79func (b Overload) params() TypeList { return b.Types }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected