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

Struct Overload

pkg/sql/sem/tree/overload.go:174–307  ·  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

172// Overload is one of the overloads of a built-in function.
173// Each FunctionDefinition may contain one or more overloads.
174type Overload struct {
175 Types TypeList
176 ReturnType ReturnTyper
177 Volatility volatility.V
178 OverloadPreference
179
180 // Info is a description of the function, which is surfaced on the CockroachDB
181 // docs site on the "Functions and Operators" page. Descriptions typically use
182 // third-person with the function as an implicit subject (e.g. "Calculates
183 // infinity"), but should focus more on ease of understanding so other structures
184 // might be more appropriate.
185 Info string
186
187 AggregateFunc AggregateOverload
188 WindowFunc WindowOverload
189
190 // Only one of the "Fn", "FnWithExprs", "Generate", "GeneratorWithExprs",
191 // "SQLFn" and "Body" attributes can be set.
192
193 // Class is the kind of built-in function (normal/aggregate/window/etc.)
194 Class FunctionClass
195
196 // Fn is the normal builtin implementation function. It's for functions that
197 // take in Datums and return a Datum.
198 //
199 // The opaque wrapper needs to be type asserted into eval.FnOverload.
200 Fn FnOverload
201
202 // FnWithExprs is for builtins that need access to their arguments as Exprs
203 // and not pre-evaluated Datums, but is otherwise identical to Fn.
204 FnWithExprs FnWithExprsOverload
205
206 // Generator is for SRFs. SRFs take Datums and return multiple rows of Datums.
207 Generator GeneratorOverload
208
209 // GeneratorWithExprs is for SRFs that need access to their arguments as Exprs
210 // and not pre-evaluated Datums, but is otherwise identical to Generator.
211 GeneratorWithExprs GeneratorWithExprsOverload
212
213 // SQLFn must be set for overloads of type SQLClass. It should return a SQL
214 // statement which will be executed as a common table expression in the query.
215 SQLFn SQLFnOverload
216
217 // OnTypeCheck, if set, is called every time this overload is type checked.
218 OnTypeCheck func()
219
220 // SpecializedVecBuiltin is used to let the vectorized engine
221 // know when an Overload has a specialized vectorized operator.
222 SpecializedVecBuiltin SpecializedVectorizedBuiltin
223
224 // IgnoreVolatilityCheck ignores checking the functions overload's
225 // Volatility against Postgres's Volatility at test time.
226 // This should be used with caution.
227 IgnoreVolatilityCheck bool
228
229 // Oid is the cached oidHasher.BuiltinOid result for this Overload. It's
230 // populated at init-time.
231 Oid oid.Oid

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected