StaticTypeInferencer

class StaticTypeInferencer(globalBindings: Bindings<StaticType>, customFunctionSignatures: List<FunctionSignature>, customTypedOpParameters: Map<String, TypedOpParameter>)

Infers the StaticType of a PartiqlAst.Statement. Assumes StaticTypeVisitorTransform was run before on this PartiqlAst.Statement and all implicit variables have been resolved.

Parameters

globalBindings

The global bindings to the static environment. This is a data catalog purely from a lookup perspective.

customFunctionSignatures

Custom user-defined function signatures that can be called by the query.

customTypedOpParameters

Mapping of custom type name to TypedOpParameter to be used for typed operators (i.e CAST/IS) inference.

Constructors

Link copied to clipboard
fun StaticTypeInferencer(globalBindings: Bindings<StaticType>, customFunctionSignatures: List<FunctionSignature>, customTypedOpParameters: Map<String, TypedOpParameter>)

Types

Link copied to clipboard
sealed class InferenceResult

Result of static type inference on a query. Can be one of:

Functions

Link copied to clipboard
fun inferStaticType(node: PartiqlAst.Statement): StaticTypeInferencer.InferenceResult

Infers the StaticType of node and returns an InferenceResult. Currently does not support inference for PartiqlAst.Statement.Dml and PartiqlAst.Statement.Ddl statements.