Documentation
¶
Index ¶
- Constants
- type AnnotatedType
- type AnnotationMap
- type AnonymizationInfo
- type ArgumentCardinality
- type ArgumentCollationMode
- type ArgumentTypeLambda
- type ArrayAnnotationMap
- type ArrayType
- func ArrayTypeFromKind(kind TypeKind) *ArrayType
- func BigNumericArrayType() *ArrayType
- func BoolArrayType() *ArrayType
- func BytesArrayType() *ArrayType
- func DateArrayType() *ArrayType
- func DatetimeArrayType() *ArrayType
- func DoubleArrayType() *ArrayType
- func FloatArrayType() *ArrayType
- func GeographyArrayType() *ArrayType
- func Int32ArrayType() *ArrayType
- func Int64ArrayType() *ArrayType
- func IntervalArrayType() *ArrayType
- func JsonArrayType() *ArrayType
- func NewArrayType(elem Type) (*ArrayType, error)
- func NumericArrayType() *ArrayType
- func StringArrayType() *ArrayType
- func TimeArrayType() *ArrayType
- func TimestampArrayType() *ArrayType
- func Uint32ArrayType() *ArrayType
- func Uint64ArrayType() *ArrayType
- func (t ArrayType) AsArray() *ArrayType
- func (t ArrayType) AsEnum() *EnumType
- func (t ArrayType) AsStruct() *StructType
- func (t ArrayType) DebugString(details bool) string
- func (t *ArrayType) ElementType() Type
- func (t ArrayType) Equals(typ Type) bool
- func (t ArrayType) Equivalent(typ Type) bool
- func (t ArrayType) HasAnyFields() bool
- func (t ArrayType) IsArray() bool
- func (t ArrayType) IsBigNumericType() bool
- func (t ArrayType) IsBool() bool
- func (t ArrayType) IsBytes() bool
- func (t ArrayType) IsCivilDateOrTimeType() bool
- func (t ArrayType) IsDate() bool
- func (t ArrayType) IsDatetime() bool
- func (t ArrayType) IsDouble() bool
- func (t ArrayType) IsEnum() bool
- func (t ArrayType) IsExtendedType() bool
- func (t ArrayType) IsFeatureV12CivilTimeType() bool
- func (t ArrayType) IsFloat() bool
- func (t ArrayType) IsFloatingPoint() bool
- func (t ArrayType) IsGeography() bool
- func (t ArrayType) IsInt32() bool
- func (t ArrayType) IsInt64() bool
- func (t ArrayType) IsInteger() bool
- func (t ArrayType) IsInteger32() bool
- func (t ArrayType) IsInteger64() bool
- func (t ArrayType) IsInterval() bool
- func (t ArrayType) IsJson() bool
- func (t ArrayType) IsJsonType() bool
- func (t ArrayType) IsNumericType() bool
- func (t ArrayType) IsNumerical() bool
- func (t ArrayType) IsProto() bool
- func (t ArrayType) IsSignedInteger() bool
- func (t ArrayType) IsSimpleType() bool
- func (t ArrayType) IsString() bool
- func (t ArrayType) IsStruct() bool
- func (t ArrayType) IsStructOrProto() bool
- func (t ArrayType) IsTime() bool
- func (t ArrayType) IsTimestamp() bool
- func (t ArrayType) IsUint32() bool
- func (t ArrayType) IsUint64() bool
- func (t ArrayType) IsUnsignedInteger() bool
- func (t ArrayType) Kind() TypeKind
- func (t ArrayType) NestingDepth() int
- func (t ArrayType) ShortTypeName(mode ProductMode) string
- func (t ArrayType) SupportsEquality() bool
- func (t ArrayType) SupportsGrouping() bool
- func (t ArrayType) SupportsOrdering() bool
- func (t ArrayType) SupportsPartitioning() bool
- func (t ArrayType) TypeName(mode ProductMode) string
- func (t ArrayType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
- func (t ArrayType) UsingFeatureV12CivilTimeType() bool
- func (t ArrayType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
- func (t ArrayType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
- type BaseAnnotationMap
- type BaseCatalog
- func (c *BaseCatalog) ExtendedTypeSuperTypes(typ Type) (*TypeListView, error)
- func (c *BaseCatalog) FindConnection(path []string) (Connection, error)
- func (c *BaseCatalog) FindConstant(path []string) (Constant, int, error)
- func (c *BaseCatalog) FindConversion(from, to Type) (Conversion, error)
- func (c *BaseCatalog) FindFunction(path []string) (*Function, error)
- func (c *BaseCatalog) FindModel(path []string) (Model, error)
- func (c *BaseCatalog) FindProcedure(path []string) (*Procedure, error)
- func (c *BaseCatalog) FindTable(path []string) (Table, error)
- func (c *BaseCatalog) FindTableValuedFunction(path []string) (TableValuedFunction, error)
- func (c *BaseCatalog) FindType(path []string) (Type, error)
- func (c *BaseCatalog) FullName() string
- func (c *BaseCatalog) SuggestConstant(mistypedPath []string) string
- func (c *BaseCatalog) SuggestFunction(mistypedPath []string) string
- func (c *BaseCatalog) SuggestModel(mistypedPath []string) string
- func (c *BaseCatalog) SuggestTable(mistypedPath []string) string
- func (c *BaseCatalog) SuggestTableValuedFunction(mistypedPath []string) string
- type BaseColumn
- type BaseEnumerableCatalog
- func (c *BaseEnumerableCatalog) Catalogs() ([]Catalog, error)
- func (c *BaseEnumerableCatalog) Conversions() ([]Conversion, error)
- func (c *BaseEnumerableCatalog) Functions() ([]*Function, error)
- func (c *BaseEnumerableCatalog) Tables() ([]Table, error)
- func (c *BaseEnumerableCatalog) Types() ([]Type, error)
- type BaseModel
- func (m *BaseModel) FindInputByName(name string) Column
- func (m *BaseModel) FindOutputByName(name string) Column
- func (m *BaseModel) FullName() string
- func (m *BaseModel) Input(i int) Column
- func (m *BaseModel) Name() string
- func (m *BaseModel) NumInputs() uint64
- func (m *BaseModel) NumOutputs() uint64
- func (m *BaseModel) Output(i int) Column
- func (m *BaseModel) SerializationID() int64
- type BaseTable
- func (t *BaseTable) AnonymizationInfo() *AnonymizationInfo
- func (t *BaseTable) Column(idx int) Column
- func (t *BaseTable) CreateEvaluatorTableIterator(columnIdxs []int) (*EvaluatorTableIterator, error)
- func (t *BaseTable) FindColumnByName(name string) Column
- func (t *BaseTable) FullName() string
- func (t *BaseTable) IsValueTable() bool
- func (t *BaseTable) Name() string
- func (t *BaseTable) NumColumns() int
- func (t *BaseTable) PrimaryKey() []int
- func (t *BaseTable) SerializationID() int64
- func (t *BaseTable) SupportsAnonymization() bool
- func (t *BaseTable) TableTypeName(mode ProductMode) string
- type BaseTableValuedFunction
- func (f *BaseTableValuedFunction) AddSignature(sig *FunctionSignature) error
- func (f *BaseTableValuedFunction) AnonymizationInfo() *AnonymizationInfo
- func (f *BaseTableValuedFunction) DebugString() string
- func (f *BaseTableValuedFunction) FullName() string
- func (f *BaseTableValuedFunction) FunctionNamePath() []string
- func (f *BaseTableValuedFunction) Name() string
- func (f *BaseTableValuedFunction) NumSignatures() int64
- func (f *BaseTableValuedFunction) SetUserIdColumnNamePath(path []string) error
- func (f *BaseTableValuedFunction) Signature(idx int64) *FunctionSignature
- func (f *BaseTableValuedFunction) Signatures() []*FunctionSignature
- func (f *BaseTableValuedFunction) SupportedSignaturesUserFacingText() string
- type BuiltinFunctionOptions
- type Catalog
- type Column
- type Connection
- type Constant
- type Conversion
- type EnumType
- func (t EnumType) AsArray() *ArrayType
- func (t EnumType) AsEnum() *EnumType
- func (t EnumType) AsStruct() *StructType
- func (t EnumType) DebugString(details bool) string
- func (t EnumType) Equals(typ Type) bool
- func (t EnumType) Equivalent(typ Type) bool
- func (t *EnumType) FindName(number int) (string, bool)
- func (t *EnumType) FindNumber(name string) (int, bool)
- func (t EnumType) HasAnyFields() bool
- func (t EnumType) IsArray() bool
- func (t EnumType) IsBigNumericType() bool
- func (t EnumType) IsBool() bool
- func (t EnumType) IsBytes() bool
- func (t EnumType) IsCivilDateOrTimeType() bool
- func (t EnumType) IsDate() bool
- func (t EnumType) IsDatetime() bool
- func (t EnumType) IsDouble() bool
- func (t EnumType) IsEnum() bool
- func (t EnumType) IsExtendedType() bool
- func (t EnumType) IsFeatureV12CivilTimeType() bool
- func (t EnumType) IsFloat() bool
- func (t EnumType) IsFloatingPoint() bool
- func (t EnumType) IsGeography() bool
- func (t EnumType) IsInt32() bool
- func (t EnumType) IsInt64() bool
- func (t EnumType) IsInteger() bool
- func (t EnumType) IsInteger32() bool
- func (t EnumType) IsInteger64() bool
- func (t EnumType) IsInterval() bool
- func (t EnumType) IsJson() bool
- func (t EnumType) IsJsonType() bool
- func (t EnumType) IsNumericType() bool
- func (t EnumType) IsNumerical() bool
- func (t EnumType) IsProto() bool
- func (t EnumType) IsSignedInteger() bool
- func (t EnumType) IsSimpleType() bool
- func (t EnumType) IsString() bool
- func (t EnumType) IsStruct() bool
- func (t EnumType) IsStructOrProto() bool
- func (t EnumType) IsTime() bool
- func (t EnumType) IsTimestamp() bool
- func (t EnumType) IsUint32() bool
- func (t EnumType) IsUint64() bool
- func (t EnumType) IsUnsignedInteger() bool
- func (t EnumType) Kind() TypeKind
- func (t EnumType) NestingDepth() int
- func (t EnumType) ShortTypeName(mode ProductMode) string
- func (t EnumType) SupportsEquality() bool
- func (t EnumType) SupportsGrouping() bool
- func (t EnumType) SupportsOrdering() bool
- func (t EnumType) SupportsPartitioning() bool
- func (t EnumType) TypeName(mode ProductMode) string
- func (t EnumType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
- func (t EnumType) UsingFeatureV12CivilTimeType() bool
- func (t EnumType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
- func (t EnumType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
- type EnumerableCatalog
- type EvaluatorTableIterator
- type Function
- func (f *Function) AddSignature(sig *FunctionSignature)
- func (f *Function) AliasName() string
- func (f *Function) ArgumentsAreCoercible() bool
- func (f *Function) DebugString(verbose bool) string
- func (f *Function) FullName(includeGroup bool) string
- func (f *Function) FunctionNamePath() []string
- func (f *Function) Group() string
- func (f *Function) IsAggregate() bool
- func (f *Function) IsAnalytic() bool
- func (f *Function) IsDeprecated() bool
- func (f *Function) IsScalar() bool
- func (f *Function) IsZetaSQLBuiltin() bool
- func (f *Function) Mode() Mode
- func (f *Function) Name() string
- func (f *Function) NumSignatures() int
- func (f *Function) QualifiedSQLName(capitalizeQualifier bool) string
- func (f *Function) RequiresWindowOrdering() bool
- func (f *Function) ResetSignatures(sigs []*FunctionSignature)
- func (f *Function) SQL(inputs []string, sig *FunctionSignature) string
- func (f *Function) SQLName() string
- func (f *Function) Signatures() []*FunctionSignature
- func (f *Function) SupportsClampedBetweenModifier() bool
- func (f *Function) SupportsDistinctModifier() bool
- func (f *Function) SupportsHavingModifier() bool
- func (f *Function) SupportsLimitArguments() bool
- func (f *Function) SupportsNullHandlingModifier() bool
- func (f *Function) SupportsOrderingArguments() bool
- func (f *Function) SupportsOverClause() bool
- func (f *Function) SupportsSafeErrorMode() bool
- func (f *Function) SupportsWindowFraming() bool
- func (f *Function) SupportsWindowOrdering() bool
- type FunctionArgumentType
- func (t *FunctionArgumentType) AllowCoercionFrom(actualArgType Type) bool
- func (t *FunctionArgumentType) ArgumentName() string
- func (t *FunctionArgumentType) Cardinality() ArgumentCardinality
- func (t *FunctionArgumentType) DebugString(verbose bool) string
- func (t *FunctionArgumentType) Default() Value
- func (t *FunctionArgumentType) HasArgumentName() bool
- func (t *FunctionArgumentType) HasDefault() bool
- func (t *FunctionArgumentType) IncrementNumOccurrences()
- func (t *FunctionArgumentType) IsConcrete() bool
- func (t *FunctionArgumentType) IsConnection() bool
- func (t *FunctionArgumentType) IsDescriptor() bool
- func (t *FunctionArgumentType) IsFixedRelation() bool
- func (t *FunctionArgumentType) IsLambda() bool
- func (t *FunctionArgumentType) IsModel() bool
- func (t *FunctionArgumentType) IsRelation() bool
- func (t *FunctionArgumentType) IsScalar() bool
- func (t *FunctionArgumentType) IsTemplated() bool
- func (t *FunctionArgumentType) IsValid(mode ProductMode) error
- func (t *FunctionArgumentType) IsVoid() bool
- func (t *FunctionArgumentType) Kind() SignatureArgumentKind
- func (t *FunctionArgumentType) Lambda() *ArgumentTypeLambda
- func (t *FunctionArgumentType) MustBeConstant() bool
- func (t *FunctionArgumentType) NumOccurrences() int
- func (t *FunctionArgumentType) Optional() bool
- func (t *FunctionArgumentType) Options() *FunctionArgumentTypeOptions
- func (t *FunctionArgumentType) Repeated() bool
- func (t *FunctionArgumentType) Required() bool
- func (t *FunctionArgumentType) SQLDeclaration(mode ProductMode) string
- func (t *FunctionArgumentType) SetNumOccurrences(num int)
- func (t *FunctionArgumentType) TemplatedKindIsRelated(kind SignatureArgumentKind) bool
- func (t *FunctionArgumentType) Type() Type
- func (t *FunctionArgumentType) UserFacingName(mode ProductMode) string
- func (t *FunctionArgumentType) UserFacingNameWithCardinality(mode ProductMode) string
- type FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) ArgumentCollationMode() ArgumentCollationMode
- func (o *FunctionArgumentTypeOptions) ArgumentName() string
- func (o *FunctionArgumentTypeOptions) ArgumentNameIsMandatory() bool
- func (o *FunctionArgumentTypeOptions) ArgumentNameParseLocation() *ParseLocationRange
- func (o *FunctionArgumentTypeOptions) ArgumentTypeParseLocation() *ParseLocationRange
- func (o *FunctionArgumentTypeOptions) Cardinality() ArgumentCardinality
- func (o *FunctionArgumentTypeOptions) ClearDefault() *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) Default() Value
- func (o *FunctionArgumentTypeOptions) ExtraRelationInputColumnsAllowed() bool
- func (o *FunctionArgumentTypeOptions) HasArgumentName() bool
- func (o *FunctionArgumentTypeOptions) HasDefault() bool
- func (o *FunctionArgumentTypeOptions) HasMaxValue() bool
- func (o *FunctionArgumentTypeOptions) HasMinValue() bool
- func (o *FunctionArgumentTypeOptions) HasRelationInputSchema() bool
- func (o *FunctionArgumentTypeOptions) IsNotAggregate() bool
- func (o *FunctionArgumentTypeOptions) MaxValue() int64
- func (o *FunctionArgumentTypeOptions) MinValue() int64
- func (o *FunctionArgumentTypeOptions) MustBeConstant() bool
- func (o *FunctionArgumentTypeOptions) MustBeNonNull() bool
- func (o *FunctionArgumentTypeOptions) MustSupportEquality() bool
- func (o *FunctionArgumentTypeOptions) MustSupportGrouping() bool
- func (o *FunctionArgumentTypeOptions) MustSupportOrdering() bool
- func (o *FunctionArgumentTypeOptions) OptionsDebugString() string
- func (o *FunctionArgumentTypeOptions) ProcedureArgumentMode() ProcedureArgumentMode
- func (o *FunctionArgumentTypeOptions) ResolveDescriptorNamesTableOffset() int
- func (o *FunctionArgumentTypeOptions) SQLDeclaration(mode ProductMode) string
- func (o *FunctionArgumentTypeOptions) SetArgumentCollationMode(mode ArgumentCollationMode) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetArgumentName(name string) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetArgumentNameIsMandatory(value bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetArgumentNameParseLocation(locRange *ParseLocationRange) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetArgumentTypeParseLocation(locRange *ParseLocationRange) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetCardinality(c ArgumentCardinality) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetDefault(value Value) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetExtraRelationInputColumnsAllowed(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetIsNotAggregate(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMaxValue(v int64) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMinValue(v int64) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMustBeConstant(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMustBeNonNull(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMustSupportEquality(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMustSupportGrouping(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetMustSupportOrdering(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetProcedureArgumentMode(mode ProcedureArgumentMode) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetResolveDescriptorNamesTableOffset(tableOffset int) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) SetUsesArrayElementForCollation(v bool) *FunctionArgumentTypeOptions
- func (o *FunctionArgumentTypeOptions) UsesArrayElementForCollation() bool
- type FunctionSignature
- func (s *FunctionSignature) AllArgumentsHaveDefaults() bool
- func (s *FunctionSignature) Arguments() []*FunctionArgumentType
- func (s *FunctionSignature) ConcreteArguments() []*FunctionArgumentType
- func (s *FunctionSignature) DebugString(functionName string, verbose bool) string
- func (s *FunctionSignature) FirstRepeatedArgumentIndex() int
- func (s *FunctionSignature) HasConcreteArguments() bool
- func (s *FunctionSignature) IsConcrete() bool
- func (s *FunctionSignature) IsDeprecated() bool
- func (s *FunctionSignature) IsInternal() bool
- func (s *FunctionSignature) IsTemplated() bool
- func (s *FunctionSignature) IsValid(mode ProductMode) error
- func (s *FunctionSignature) IsValidForFunction() error
- func (s *FunctionSignature) IsValidForProcedure() error
- func (s *FunctionSignature) IsValidForTableValuedFunction() error
- func (s *FunctionSignature) LastRepeatedArgumentIndex() int
- func (s *FunctionSignature) NumOptionalArguments() int
- func (s *FunctionSignature) NumRepeatedArguments() int
- func (s *FunctionSignature) NumRequiredArguments() int
- func (s *FunctionSignature) Options() *FunctionSignatureOptions
- func (s *FunctionSignature) ResultType() *FunctionArgumentType
- func (s *FunctionSignature) SQLDeclaration(argumentNames []string, mode ProductMode) string
- func (s *FunctionSignature) SetConcreteResultType(typ Type)
- func (s *FunctionSignature) SetIsDeprecated(v bool)
- type FunctionSignatureOptions
- type Mode
- type Model
- type ParseLocationPoint
- type ParseLocationRange
- type Procedure
- type ProcedureArgumentMode
- type ProductMode
- type SQLTableValuedFunction
- type SignatureArgumentKind
- type SimpleCatalog
- func (c *SimpleCatalog) AddCatalog(catalog Catalog)
- func (c *SimpleCatalog) AddCatalogWithName(name string, catalog Catalog)
- func (c *SimpleCatalog) AddConnection(conn Connection)
- func (c *SimpleCatalog) AddConnectionWithName(name string, conn Connection)
- func (c *SimpleCatalog) AddConstant(cons Constant)
- func (c *SimpleCatalog) AddConstantWithName(name string, cons Constant)
- func (c *SimpleCatalog) AddFunction(fn *Function)
- func (c *SimpleCatalog) AddFunctionWithName(name string, fn *Function)
- func (c *SimpleCatalog) AddModel(model Model)
- func (c *SimpleCatalog) AddModelWithName(name string, model Model)
- func (c *SimpleCatalog) AddProcedure(proc *Procedure)
- func (c *SimpleCatalog) AddProcedureWithName(name string, proc *Procedure)
- func (c *SimpleCatalog) AddTable(table Table)
- func (c *SimpleCatalog) AddTableValuedFunction(fn TableValuedFunction)
- func (c *SimpleCatalog) AddTableValuedFunctionWithName(name string, fn TableValuedFunction)
- func (c *SimpleCatalog) AddTableWithName(name string, table Table)
- func (c *SimpleCatalog) AddType(name string, typ Type)
- func (c *SimpleCatalog) AddTypeIfNotPresent(name string, typ Type) bool
- func (c *SimpleCatalog) AddZetaSQLBuiltinFunctions(opt *BuiltinFunctionOptions)
- func (c *SimpleCatalog) Catalog(name string) (*SimpleCatalog, error)
- func (c *SimpleCatalog) CatalogNames() []string
- func (c *SimpleCatalog) Catalogs() ([]Catalog, error)
- func (c *SimpleCatalog) Connection(name string) (Connection, error)
- func (c *SimpleCatalog) Constant(name string) (Constant, error)
- func (c *SimpleCatalog) ConstantNames() []string
- func (c *SimpleCatalog) Constants() ([]Constant, error)
- func (c *SimpleCatalog) Function(name string) (*Function, error)
- func (c *SimpleCatalog) FunctionNames() []string
- func (c *SimpleCatalog) Functions() ([]*Function, error)
- func (c *SimpleCatalog) Model(name string) (Model, error)
- func (c *SimpleCatalog) Procedure(name string) (*Procedure, error)
- func (c *SimpleCatalog) Procedures() []*Procedure
- func (c *SimpleCatalog) Table(name string) (Table, error)
- func (c *SimpleCatalog) TableNames() []string
- func (c *SimpleCatalog) TableValuedFunction(name string) (TableValuedFunction, error)
- func (c *SimpleCatalog) TableValuedFunctionNames() []string
- func (c *SimpleCatalog) TableValuedFunctions() []TableValuedFunction
- func (c *SimpleCatalog) Tables() ([]Table, error)
- func (c *SimpleCatalog) Type(name string) (Type, error)
- func (c *SimpleCatalog) Types() ([]Type, error)
- type SimpleColumn
- type SimpleModel
- type SimpleTable
- func (t *SimpleTable) AddColumn(col Column) error
- func (t *SimpleTable) AllowAnonymousColumnName() bool
- func (t *SimpleTable) AllowDuplicateColumnNames() bool
- func (t *SimpleTable) SetAllowAnonymousColumnName(value bool) error
- func (t *SimpleTable) SetAllowDuplicateColumnNames(value bool) error
- func (t *SimpleTable) SetFullName(fullName string) error
- func (t *SimpleTable) SetIsValueTable(value bool)
- func (t *SimpleTable) SetPrimaryKey(primaryKey []int) error
- type StructAnnotationMap
- type StructField
- type StructType
- func (t StructType) AsArray() *ArrayType
- func (t StructType) AsEnum() *EnumType
- func (t StructType) AsStruct() *StructType
- func (t StructType) DebugString(details bool) string
- func (t StructType) Equals(typ Type) bool
- func (t StructType) Equivalent(typ Type) bool
- func (t *StructType) Field(i int) *StructField
- func (t *StructType) Fields() []*StructField
- func (t StructType) HasAnyFields() bool
- func (t StructType) IsArray() bool
- func (t StructType) IsBigNumericType() bool
- func (t StructType) IsBool() bool
- func (t StructType) IsBytes() bool
- func (t StructType) IsCivilDateOrTimeType() bool
- func (t StructType) IsDate() bool
- func (t StructType) IsDatetime() bool
- func (t StructType) IsDouble() bool
- func (t StructType) IsEnum() bool
- func (t StructType) IsExtendedType() bool
- func (t StructType) IsFeatureV12CivilTimeType() bool
- func (t StructType) IsFloat() bool
- func (t StructType) IsFloatingPoint() bool
- func (t StructType) IsGeography() bool
- func (t StructType) IsInt32() bool
- func (t StructType) IsInt64() bool
- func (t StructType) IsInteger() bool
- func (t StructType) IsInteger32() bool
- func (t StructType) IsInteger64() bool
- func (t StructType) IsInterval() bool
- func (t StructType) IsJson() bool
- func (t StructType) IsJsonType() bool
- func (t StructType) IsNumericType() bool
- func (t StructType) IsNumerical() bool
- func (t StructType) IsProto() bool
- func (t StructType) IsSignedInteger() bool
- func (t StructType) IsSimpleType() bool
- func (t StructType) IsString() bool
- func (t StructType) IsStruct() bool
- func (t StructType) IsStructOrProto() bool
- func (t StructType) IsTime() bool
- func (t StructType) IsTimestamp() bool
- func (t StructType) IsUint32() bool
- func (t StructType) IsUint64() bool
- func (t StructType) IsUnsignedInteger() bool
- func (t StructType) Kind() TypeKind
- func (t StructType) NestingDepth() int
- func (t *StructType) NumFields() int
- func (t StructType) ShortTypeName(mode ProductMode) string
- func (t StructType) SupportsEquality() bool
- func (t StructType) SupportsGrouping() bool
- func (t StructType) SupportsOrdering() bool
- func (t StructType) SupportsPartitioning() bool
- func (t StructType) TypeName(mode ProductMode) string
- func (t StructType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
- func (t StructType) UsingFeatureV12CivilTimeType() bool
- func (t StructType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
- func (t StructType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
- type TVFSignature
- type Table
- type TableValuedFunction
- type Type
- func BigNumericType() Type
- func BoolType() Type
- func BytesType() Type
- func DateType() Type
- func DatetimeType() Type
- func DoubleType() Type
- func EmptyStructType() Type
- func FloatType() Type
- func GeographyType() Type
- func Int32Type() Type
- func Int64Type() Type
- func IntervalType() Type
- func JsonType() Type
- func NumericType() Type
- func StringType() Type
- func TimeType() Type
- func TimestampType() Type
- func TypeFromKind(kind TypeKind) Type
- func TypeOf(v interface{}) Type
- func Uint32Type() Type
- func Uint64Type() Type
- type TypeKind
- type TypeList
- type TypeListView
- type TypeParameterValue
- type TypeParameters
- type Value
Constants ¶
const ( UNKNOWN TypeKind = 0 INT32 = 1 INT64 = 2 UINT32 = 3 UINT64 = 4 BOOL = 5 FLOAT = 6 DOUBLE = 7 STRING = 8 BYTES = 9 DATE = 10 TIMESTAMP = 19 ENUM = 15 ARRAY = 16 STRUCT = 17 PROTO = 18 TIME = 20 DATETIME = 21 GEOGRAPHY = 22 NUMERIC = 23 BIG_NUMERIC = 24 EXTENDED = 25 JSON = 26 INTERVAL = 27 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnotatedType ¶
type AnnotatedType struct {
// contains filtered or unexported fields
}
AnnotatedType holds unowned pointers to Type and AnnoationMap. <annotation_map> could be nil to indicate that the <type> doesn't have annotation.
func (*AnnotatedType) AnnotationMap ¶
func (t *AnnotatedType) AnnotationMap() AnnotationMap
func (*AnnotatedType) Type ¶
func (t *AnnotatedType) Type() Type
type AnnotationMap ¶
type AnnotationMap interface { IsStructMap() bool IsArrayMap() bool // contains filtered or unexported methods }
AnnotationMap maps from AnnotationSpec ID to SimpleValue.
type AnonymizationInfo ¶
type AnonymizationInfo struct {
// contains filtered or unexported fields
}
type ArgumentCardinality ¶
type ArgumentCardinality int
const ( RequiredArgumentCardinality ArgumentCardinality = 0 RepeatedArgumentCardinality ArgumentCardinality = 1 OptionalArgumentCardinality ArgumentCardinality = 2 )
type ArgumentCollationMode ¶ added in v0.5.0
type ArgumentCollationMode int
const ( AffectsNone ArgumentCollationMode = 0 AffectsOperation ArgumentCollationMode = 1 AffectsPropagation ArgumentCollationMode = 2 AffectsOperationAndPropagation ArgumentCollationMode = 3 )
type ArgumentTypeLambda ¶
type ArgumentTypeLambda struct {
// contains filtered or unexported fields
}
ArgumentTypeLambda contains type information for ARG_TYPE_LAMBDA, which represents the lambda type of a function argument. A lambda has a list of arguments and a body. Both the lambda arguments and body could be templated or nontemplated. Putting them together to minimize stack usage of FunctionArgumentType.
func (*ArgumentTypeLambda) ArgumentTypes ¶
func (t *ArgumentTypeLambda) ArgumentTypes() []*FunctionArgumentType
func (*ArgumentTypeLambda) BodyType ¶
func (t *ArgumentTypeLambda) BodyType() *FunctionArgumentType
type ArrayAnnotationMap ¶
type ArrayAnnotationMap struct {
*BaseAnnotationMap
}
type ArrayType ¶
type ArrayType struct {
// contains filtered or unexported fields
}
func ArrayTypeFromKind ¶
func BigNumericArrayType ¶
func BigNumericArrayType() *ArrayType
func BoolArrayType ¶
func BoolArrayType() *ArrayType
func BytesArrayType ¶
func BytesArrayType() *ArrayType
func DateArrayType ¶
func DateArrayType() *ArrayType
func DatetimeArrayType ¶
func DatetimeArrayType() *ArrayType
func DoubleArrayType ¶
func DoubleArrayType() *ArrayType
func FloatArrayType ¶
func FloatArrayType() *ArrayType
func GeographyArrayType ¶
func GeographyArrayType() *ArrayType
func Int32ArrayType ¶
func Int32ArrayType() *ArrayType
func Int64ArrayType ¶
func Int64ArrayType() *ArrayType
func IntervalArrayType ¶
func IntervalArrayType() *ArrayType
func JsonArrayType ¶
func JsonArrayType() *ArrayType
func NewArrayType ¶
func NumericArrayType ¶
func NumericArrayType() *ArrayType
func StringArrayType ¶
func StringArrayType() *ArrayType
func TimeArrayType ¶
func TimeArrayType() *ArrayType
func TimestampArrayType ¶
func TimestampArrayType() *ArrayType
func Uint32ArrayType ¶
func Uint32ArrayType() *ArrayType
func Uint64ArrayType ¶
func Uint64ArrayType() *ArrayType
func (ArrayType) AsStruct ¶ added in v0.2.5
func (t ArrayType) AsStruct() *StructType
func (ArrayType) DebugString ¶
func (*ArrayType) ElementType ¶
func (ArrayType) Equivalent ¶
func (ArrayType) HasAnyFields ¶
func (t ArrayType) HasAnyFields() bool
func (ArrayType) IsBigNumericType ¶
func (t ArrayType) IsBigNumericType() bool
func (ArrayType) IsCivilDateOrTimeType ¶
func (t ArrayType) IsCivilDateOrTimeType() bool
func (ArrayType) IsDatetime ¶
func (t ArrayType) IsDatetime() bool
func (ArrayType) IsExtendedType ¶
func (t ArrayType) IsExtendedType() bool
func (ArrayType) IsFeatureV12CivilTimeType ¶
func (t ArrayType) IsFeatureV12CivilTimeType() bool
func (ArrayType) IsFloatingPoint ¶
func (t ArrayType) IsFloatingPoint() bool
func (ArrayType) IsGeography ¶
func (t ArrayType) IsGeography() bool
func (ArrayType) IsInteger32 ¶
func (t ArrayType) IsInteger32() bool
func (ArrayType) IsInteger64 ¶
func (t ArrayType) IsInteger64() bool
func (ArrayType) IsInterval ¶
func (t ArrayType) IsInterval() bool
func (ArrayType) IsJsonType ¶
func (t ArrayType) IsJsonType() bool
func (ArrayType) IsNumericType ¶
func (t ArrayType) IsNumericType() bool
func (ArrayType) IsNumerical ¶
func (t ArrayType) IsNumerical() bool
func (ArrayType) IsSignedInteger ¶
func (t ArrayType) IsSignedInteger() bool
func (ArrayType) IsSimpleType ¶
func (t ArrayType) IsSimpleType() bool
func (ArrayType) IsStructOrProto ¶
func (t ArrayType) IsStructOrProto() bool
func (ArrayType) IsTimestamp ¶
func (t ArrayType) IsTimestamp() bool
func (ArrayType) IsUnsignedInteger ¶
func (t ArrayType) IsUnsignedInteger() bool
func (ArrayType) NestingDepth ¶
func (t ArrayType) NestingDepth() int
func (ArrayType) ShortTypeName ¶
func (t ArrayType) ShortTypeName(mode ProductMode) string
func (ArrayType) SupportsEquality ¶
func (t ArrayType) SupportsEquality() bool
func (ArrayType) SupportsGrouping ¶
func (t ArrayType) SupportsGrouping() bool
func (ArrayType) SupportsOrdering ¶
func (t ArrayType) SupportsOrdering() bool
func (ArrayType) SupportsPartitioning ¶
func (t ArrayType) SupportsPartitioning() bool
func (ArrayType) TypeName ¶
func (t ArrayType) TypeName(mode ProductMode) string
func (ArrayType) TypeNameWithParameters ¶
func (t ArrayType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
func (ArrayType) UsingFeatureV12CivilTimeType ¶
func (t ArrayType) UsingFeatureV12CivilTimeType() bool
func (ArrayType) ValidateAndResolveTypeParameters ¶
func (t ArrayType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
func (ArrayType) ValidateResolvedTypeParameters ¶
func (t ArrayType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
type BaseAnnotationMap ¶
type BaseAnnotationMap struct {
// contains filtered or unexported fields
}
func (*BaseAnnotationMap) IsArrayMap ¶
func (m *BaseAnnotationMap) IsArrayMap() bool
func (*BaseAnnotationMap) IsStructMap ¶
func (m *BaseAnnotationMap) IsStructMap() bool
type BaseCatalog ¶
type BaseCatalog struct {
// contains filtered or unexported fields
}
func (*BaseCatalog) ExtendedTypeSuperTypes ¶
func (c *BaseCatalog) ExtendedTypeSuperTypes(typ Type) (*TypeListView, error)
func (*BaseCatalog) FindConnection ¶
func (c *BaseCatalog) FindConnection(path []string) (Connection, error)
func (*BaseCatalog) FindConstant ¶
func (c *BaseCatalog) FindConstant(path []string) (Constant, int, error)
func (*BaseCatalog) FindConversion ¶
func (c *BaseCatalog) FindConversion(from, to Type) (Conversion, error)
func (*BaseCatalog) FindFunction ¶
func (c *BaseCatalog) FindFunction(path []string) (*Function, error)
func (*BaseCatalog) FindProcedure ¶
func (c *BaseCatalog) FindProcedure(path []string) (*Procedure, error)
func (*BaseCatalog) FindTableValuedFunction ¶
func (c *BaseCatalog) FindTableValuedFunction(path []string) (TableValuedFunction, error)
func (*BaseCatalog) FullName ¶
func (c *BaseCatalog) FullName() string
func (*BaseCatalog) SuggestConstant ¶
func (c *BaseCatalog) SuggestConstant(mistypedPath []string) string
func (*BaseCatalog) SuggestFunction ¶
func (c *BaseCatalog) SuggestFunction(mistypedPath []string) string
func (*BaseCatalog) SuggestModel ¶
func (c *BaseCatalog) SuggestModel(mistypedPath []string) string
func (*BaseCatalog) SuggestTable ¶
func (c *BaseCatalog) SuggestTable(mistypedPath []string) string
func (*BaseCatalog) SuggestTableValuedFunction ¶
func (c *BaseCatalog) SuggestTableValuedFunction(mistypedPath []string) string
type BaseColumn ¶
type BaseColumn struct {
// contains filtered or unexported fields
}
func (*BaseColumn) FullName ¶
func (c *BaseColumn) FullName() string
func (*BaseColumn) IsPseudoColumn ¶
func (c *BaseColumn) IsPseudoColumn() bool
func (*BaseColumn) IsWritableColumn ¶
func (c *BaseColumn) IsWritableColumn() bool
func (*BaseColumn) Name ¶
func (c *BaseColumn) Name() string
func (*BaseColumn) Type ¶
func (c *BaseColumn) Type() Type
func (*BaseColumn) TypeAnnotationMap ¶
func (c *BaseColumn) TypeAnnotationMap() AnnotationMap
type BaseEnumerableCatalog ¶
type BaseEnumerableCatalog struct {
*BaseCatalog
}
func (*BaseEnumerableCatalog) Catalogs ¶
func (c *BaseEnumerableCatalog) Catalogs() ([]Catalog, error)
func (*BaseEnumerableCatalog) Conversions ¶
func (c *BaseEnumerableCatalog) Conversions() ([]Conversion, error)
func (*BaseEnumerableCatalog) Functions ¶
func (c *BaseEnumerableCatalog) Functions() ([]*Function, error)
func (*BaseEnumerableCatalog) Tables ¶
func (c *BaseEnumerableCatalog) Tables() ([]Table, error)
func (*BaseEnumerableCatalog) Types ¶
func (c *BaseEnumerableCatalog) Types() ([]Type, error)
type BaseModel ¶ added in v0.2.5
type BaseModel struct {
// contains filtered or unexported fields
}
func (*BaseModel) FindInputByName ¶ added in v0.2.5
func (*BaseModel) FindOutputByName ¶ added in v0.2.5
func (*BaseModel) NumOutputs ¶ added in v0.2.5
func (*BaseModel) SerializationID ¶ added in v0.2.5
type BaseTable ¶
type BaseTable struct {
// contains filtered or unexported fields
}
func (*BaseTable) AnonymizationInfo ¶
func (t *BaseTable) AnonymizationInfo() *AnonymizationInfo
func (*BaseTable) CreateEvaluatorTableIterator ¶
func (t *BaseTable) CreateEvaluatorTableIterator(columnIdxs []int) (*EvaluatorTableIterator, error)
func (*BaseTable) FindColumnByName ¶
func (*BaseTable) IsValueTable ¶
func (*BaseTable) NumColumns ¶
func (*BaseTable) PrimaryKey ¶
func (*BaseTable) SerializationID ¶
func (*BaseTable) SupportsAnonymization ¶
func (*BaseTable) TableTypeName ¶
func (t *BaseTable) TableTypeName(mode ProductMode) string
type BaseTableValuedFunction ¶ added in v0.2.5
type BaseTableValuedFunction struct {
// contains filtered or unexported fields
}
func (*BaseTableValuedFunction) AddSignature ¶ added in v0.2.5
func (f *BaseTableValuedFunction) AddSignature(sig *FunctionSignature) error
func (*BaseTableValuedFunction) AnonymizationInfo ¶ added in v0.2.5
func (f *BaseTableValuedFunction) AnonymizationInfo() *AnonymizationInfo
func (*BaseTableValuedFunction) DebugString ¶ added in v0.2.5
func (f *BaseTableValuedFunction) DebugString() string
func (*BaseTableValuedFunction) FullName ¶ added in v0.2.5
func (f *BaseTableValuedFunction) FullName() string
func (*BaseTableValuedFunction) FunctionNamePath ¶ added in v0.2.5
func (f *BaseTableValuedFunction) FunctionNamePath() []string
func (*BaseTableValuedFunction) Name ¶ added in v0.2.5
func (f *BaseTableValuedFunction) Name() string
func (*BaseTableValuedFunction) NumSignatures ¶ added in v0.2.5
func (f *BaseTableValuedFunction) NumSignatures() int64
func (*BaseTableValuedFunction) SetUserIdColumnNamePath ¶ added in v0.2.5
func (f *BaseTableValuedFunction) SetUserIdColumnNamePath(path []string) error
func (*BaseTableValuedFunction) Signature ¶ added in v0.2.5
func (f *BaseTableValuedFunction) Signature(idx int64) *FunctionSignature
func (*BaseTableValuedFunction) Signatures ¶ added in v0.2.5
func (f *BaseTableValuedFunction) Signatures() []*FunctionSignature
func (*BaseTableValuedFunction) SupportedSignaturesUserFacingText ¶ added in v0.2.5
func (f *BaseTableValuedFunction) SupportedSignaturesUserFacingText() string
type BuiltinFunctionOptions ¶ added in v0.3.3
type BuiltinFunctionOptions struct {
// contains filtered or unexported fields
}
type Catalog ¶
type Catalog interface { FullName() string FindTable(path []string) (Table, error) FindModel(path []string) (Model, error) FindConnection(path []string) (Connection, error) FindFunction(path []string) (*Function, error) FindTableValuedFunction(path []string) (TableValuedFunction, error) FindProcedure(path []string) (*Procedure, error) FindType(path []string) (Type, error) FindConstant(path []string) (Constant, int, error) FindConversion(from, to Type) (Conversion, error) ExtendedTypeSuperTypes(typ Type) (*TypeListView, error) SuggestTable(mistypedPath []string) string SuggestModel(mistypedPath []string) string SuggestFunction(mistypedPath []string) string SuggestTableValuedFunction(mistypedPath []string) string SuggestConstant(mistypedPath []string) string }
type Connection ¶
type Conversion ¶
type Conversion interface{}
type EnumType ¶
type EnumType struct {
// contains filtered or unexported fields
}
func DatePartEnumType ¶
func DatePartEnumType() *EnumType
func NormalizeModeEnumType ¶
func NormalizeModeEnumType() *EnumType
func (EnumType) AsStruct ¶ added in v0.2.5
func (t EnumType) AsStruct() *StructType
func (EnumType) DebugString ¶
func (EnumType) Equivalent ¶
func (EnumType) HasAnyFields ¶
func (t EnumType) HasAnyFields() bool
func (EnumType) IsBigNumericType ¶
func (t EnumType) IsBigNumericType() bool
func (EnumType) IsCivilDateOrTimeType ¶
func (t EnumType) IsCivilDateOrTimeType() bool
func (EnumType) IsDatetime ¶
func (t EnumType) IsDatetime() bool
func (EnumType) IsExtendedType ¶
func (t EnumType) IsExtendedType() bool
func (EnumType) IsFeatureV12CivilTimeType ¶
func (t EnumType) IsFeatureV12CivilTimeType() bool
func (EnumType) IsFloatingPoint ¶
func (t EnumType) IsFloatingPoint() bool
func (EnumType) IsGeography ¶
func (t EnumType) IsGeography() bool
func (EnumType) IsInteger32 ¶
func (t EnumType) IsInteger32() bool
func (EnumType) IsInteger64 ¶
func (t EnumType) IsInteger64() bool
func (EnumType) IsInterval ¶
func (t EnumType) IsInterval() bool
func (EnumType) IsJsonType ¶
func (t EnumType) IsJsonType() bool
func (EnumType) IsNumericType ¶
func (t EnumType) IsNumericType() bool
func (EnumType) IsNumerical ¶
func (t EnumType) IsNumerical() bool
func (EnumType) IsSignedInteger ¶
func (t EnumType) IsSignedInteger() bool
func (EnumType) IsSimpleType ¶
func (t EnumType) IsSimpleType() bool
func (EnumType) IsStructOrProto ¶
func (t EnumType) IsStructOrProto() bool
func (EnumType) IsTimestamp ¶
func (t EnumType) IsTimestamp() bool
func (EnumType) IsUnsignedInteger ¶
func (t EnumType) IsUnsignedInteger() bool
func (EnumType) NestingDepth ¶
func (t EnumType) NestingDepth() int
func (EnumType) ShortTypeName ¶
func (t EnumType) ShortTypeName(mode ProductMode) string
func (EnumType) SupportsEquality ¶
func (t EnumType) SupportsEquality() bool
func (EnumType) SupportsGrouping ¶
func (t EnumType) SupportsGrouping() bool
func (EnumType) SupportsOrdering ¶
func (t EnumType) SupportsOrdering() bool
func (EnumType) SupportsPartitioning ¶
func (t EnumType) SupportsPartitioning() bool
func (EnumType) TypeName ¶
func (t EnumType) TypeName(mode ProductMode) string
func (EnumType) TypeNameWithParameters ¶
func (t EnumType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
func (EnumType) UsingFeatureV12CivilTimeType ¶
func (t EnumType) UsingFeatureV12CivilTimeType() bool
func (EnumType) ValidateAndResolveTypeParameters ¶
func (t EnumType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
func (EnumType) ValidateResolvedTypeParameters ¶
func (t EnumType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
type EnumerableCatalog ¶
type EvaluatorTableIterator ¶
type EvaluatorTableIterator struct {
// contains filtered or unexported fields
}
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function interface identifies the functions available in a query engine. Each Function includes a set of FunctionSignatures, where a signature indicates:
- Argument and result types.
- A 'context' for the signature.
A Function also indicates the 'group' it belongs to.
The Function also includes <function_options_> for specifying additional resolution requirements, if any. Additionally, <function_options_> can identify a function alias/synonym that Catalogs must expose for function lookups by name.
func NewFunction ¶ added in v0.2.5
func NewFunction(namePath []string, group string, mode Mode, sigs []*FunctionSignature) *Function
Functions in a nested catalog should use the constructor with the <namePath>, identifying the full path name of the function including its containing catalog names.
These constructors perform ZETASQL_CHECK validations of basic invariants: * Scalar functions cannot support the OVER clause. * Analytic functions must support OVER clause. * Signatures must satisfy FunctionSignature.IsValidForFunction().
func (*Function) AddSignature ¶
func (f *Function) AddSignature(sig *FunctionSignature)
AddSignature adds a function signature to an existing function.
func (*Function) ArgumentsAreCoercible ¶
func (*Function) DebugString ¶
DebugString returns the function name. If <verbose> then also returns DebugString() of all its function signatures.
func (*Function) FullName ¶
FullName returns <function_name_path_> strings joined with '.', and if <include_group> is true then it is prefixed with the group name.
func (*Function) FunctionNamePath ¶
func (*Function) IsAggregate ¶
func (*Function) IsAnalytic ¶
func (*Function) IsZetaSQLBuiltin ¶
func (*Function) NumSignatures ¶
NumSignatures returns the number of function signatures.
func (*Function) QualifiedSQLName ¶
QualifiedSQLName returns SQLName() prefixed with either 'operator ' or 'function ', and 'aggregate ' or 'analytic ' if appropriate. If <capitalize_qualifier> is true, then the first letter of the (first) qualifier is capitalized (i.e., 'Operator' vs. 'operator' and 'Analytic function' vs. 'analytic function'). A function uses the 'operator ' prefix if its name starts with '$'.
func (*Function) RequiresWindowOrdering ¶
RequiresWindowOrdering returns true if ORDER BY must be specified in a window definition for this function.
func (*Function) ResetSignatures ¶
func (f *Function) ResetSignatures(sigs []*FunctionSignature)
func (*Function) SQLName ¶
SQLName returns an external 'SQL' name for the function, for use in error messages and anywhere else appropriate. If <function_options_> has its <sql_name> set then it returns <sql_name>. If <sql_name> is not set and Name() is an internal function name (starting with '$'), then it strips off the '$' and converts any '_' to ' '. Otherwise it simply returns Name() for ZetaSQL builtin functions and FullName() for non-builtin functions.
func (*Function) Signatures ¶
func (f *Function) Signatures() []*FunctionSignature
Signatures returns all of the function signatures.
func (*Function) SupportsClampedBetweenModifier ¶
SupportsClampedBetweenModifier returns true if CLAMPED BETWEEN is allowed in the function arguments. Must only be true for differential privacy functions.
func (*Function) SupportsDistinctModifier ¶
SupportsDistinctModifier returns true if DISTINCT is allowed in the function arguments.
func (*Function) SupportsHavingModifier ¶
SupportsHavingModifier returns true if HAVING is allowed in the function arguments.
func (*Function) SupportsLimitArguments ¶
SupportsLimitArguments returns true if LIMIT is allowed in the function arguments.
func (*Function) SupportsNullHandlingModifier ¶
SupportsNullHandlingModifier returns true if IGNORE NULLS and RESPECT NULLS are allowed in the function arguments.
func (*Function) SupportsOrderingArguments ¶
SupportsOrderingArguments returns true if order by is allowed in the function arguments.
func (*Function) SupportsOverClause ¶
SupportsOverClause returns true if it supports the OVER clause (i.e. this function can act as an analytic function). If true, the mode cannot be SCALAR.
func (*Function) SupportsSafeErrorMode ¶
SupportsSafeErrorMode returns true if this function supports SAFE_ERROR_MODE. See full comment on field definition.
func (*Function) SupportsWindowFraming ¶
SupportsWindowFraming returns true if window framing clause is allowed in a window definition for this function.
func (*Function) SupportsWindowOrdering ¶
SupportsWindowOrdering returns true if ORDER BY is allowed in a window definition for this function.
type FunctionArgumentType ¶
type FunctionArgumentType struct {
// contains filtered or unexported fields
}
FunctionArgumentType a type for an argument or result value in a function signature. Types can be fixed or templated. Arguments can be marked as repeated (denoting it can occur zero or more times in a function invocation) or optional. Result types cannot be marked as repeated or optional. Type VOID is valid for the return type in Procedures and in DropFunctionStmtNode only; VOID is not allowed as the return type for Functions, and is never allowed as a argument type. A FunctionArgumentType is concrete if it is not templated and num_occurrences_ indicates how many times the argument appears in a concrete FunctionSignature. FunctionArgumentTypeOptions can be used to apply additional constraints on legal values for the argument.
func NewFunctionArgumentType ¶ added in v0.2.5
func NewFunctionArgumentType(typ Type, opt *FunctionArgumentTypeOptions) *FunctionArgumentType
func NewTemplatedFunctionArgumentType ¶ added in v0.5.0
func NewTemplatedFunctionArgumentType(kind SignatureArgumentKind, opt *FunctionArgumentTypeOptions) *FunctionArgumentType
func (*FunctionArgumentType) AllowCoercionFrom ¶
func (t *FunctionArgumentType) AllowCoercionFrom(actualArgType Type) bool
func (*FunctionArgumentType) ArgumentName ¶
func (t *FunctionArgumentType) ArgumentName() string
func (*FunctionArgumentType) Cardinality ¶
func (t *FunctionArgumentType) Cardinality() ArgumentCardinality
func (*FunctionArgumentType) DebugString ¶
func (t *FunctionArgumentType) DebugString(verbose bool) string
DebugString if verbose is true, include FunctionOptions modifiers.
func (*FunctionArgumentType) Default ¶
func (t *FunctionArgumentType) Default() Value
Default returns default value provided in the argument option, or nil if the argument does not have a default value.
func (*FunctionArgumentType) HasArgumentName ¶
func (t *FunctionArgumentType) HasArgumentName() bool
func (*FunctionArgumentType) HasDefault ¶
func (t *FunctionArgumentType) HasDefault() bool
HasDefault returns TRUE if the argument has a default value provided in the argument option.
func (*FunctionArgumentType) IncrementNumOccurrences ¶
func (t *FunctionArgumentType) IncrementNumOccurrences()
func (*FunctionArgumentType) IsConcrete ¶
func (t *FunctionArgumentType) IsConcrete() bool
IsConcrete returns true if kind is ARG_TYPE_FIXED or ARG_TYPE_RELATION and the number of occurrences is greater than -1.
func (*FunctionArgumentType) IsConnection ¶
func (t *FunctionArgumentType) IsConnection() bool
func (*FunctionArgumentType) IsDescriptor ¶
func (t *FunctionArgumentType) IsDescriptor() bool
func (*FunctionArgumentType) IsFixedRelation ¶
func (t *FunctionArgumentType) IsFixedRelation() bool
func (*FunctionArgumentType) IsLambda ¶
func (t *FunctionArgumentType) IsLambda() bool
func (*FunctionArgumentType) IsModel ¶
func (t *FunctionArgumentType) IsModel() bool
func (*FunctionArgumentType) IsRelation ¶
func (t *FunctionArgumentType) IsRelation() bool
func (*FunctionArgumentType) IsScalar ¶
func (t *FunctionArgumentType) IsScalar() bool
func (*FunctionArgumentType) IsTemplated ¶
func (t *FunctionArgumentType) IsTemplated() bool
func (*FunctionArgumentType) IsValid ¶
func (t *FunctionArgumentType) IsValid(mode ProductMode) error
IsValid checks concrete arguments to validate the number of occurrences.
func (*FunctionArgumentType) IsVoid ¶
func (t *FunctionArgumentType) IsVoid() bool
func (*FunctionArgumentType) Kind ¶
func (t *FunctionArgumentType) Kind() SignatureArgumentKind
func (*FunctionArgumentType) Lambda ¶
func (t *FunctionArgumentType) Lambda() *ArgumentTypeLambda
Lambda returns information about a lambda typed function argument.
func (*FunctionArgumentType) MustBeConstant ¶
func (t *FunctionArgumentType) MustBeConstant() bool
func (*FunctionArgumentType) NumOccurrences ¶
func (t *FunctionArgumentType) NumOccurrences() int
func (*FunctionArgumentType) Optional ¶
func (t *FunctionArgumentType) Optional() bool
func (*FunctionArgumentType) Options ¶ added in v0.5.0
func (t *FunctionArgumentType) Options() *FunctionArgumentTypeOptions
func (*FunctionArgumentType) Repeated ¶
func (t *FunctionArgumentType) Repeated() bool
func (*FunctionArgumentType) Required ¶
func (t *FunctionArgumentType) Required() bool
func (*FunctionArgumentType) SQLDeclaration ¶
func (t *FunctionArgumentType) SQLDeclaration(mode ProductMode) string
SQLDeclaration get the SQL declaration for this argument, including all options. The result is formatted as SQL that can be included inside a function signature in CREATE FUNCTION, DROP FUNCTION, etc, if possible.
func (*FunctionArgumentType) SetNumOccurrences ¶
func (t *FunctionArgumentType) SetNumOccurrences(num int)
func (*FunctionArgumentType) TemplatedKindIsRelated ¶
func (t *FunctionArgumentType) TemplatedKindIsRelated(kind SignatureArgumentKind) bool
TemplatedKindIsRelated returns TRUE if kind() can be used to derive something about kind. For example, if kind() is ARG_ARRAY_TYPE_ANY_1, it can be used to derive information about ARG_TYPE_ANY_1, but not ARG_TYPE_ANY_2. Likewise, a proto map key can be used to derive information about the map itself, but not about the map value.
func (*FunctionArgumentType) Type ¶
func (t *FunctionArgumentType) Type() Type
Type returns nil if kind is not ARG_TYPE_FIXED or ARG_TYPE_LAMBDA. If kind is ARG_TYPE_LAMBDA, returns the type of lambda body type, which could be nil if the body type is templated.
func (*FunctionArgumentType) UserFacingName ¶
func (t *FunctionArgumentType) UserFacingName(mode ProductMode) string
UserFacingName returns argument type name to be used in error messages. This either would be a scalar short type name - DATE, INT64, BYTES etc. or STRUCT, PROTO, ENUM for complex type names, or ANY when any data type is allowed.
func (*FunctionArgumentType) UserFacingNameWithCardinality ¶
func (t *FunctionArgumentType) UserFacingNameWithCardinality(mode ProductMode) string
UserFacingNameWithCardinality returns user facing text for the argument including argument cardinality (to be used in error message):
- required, just argument type, e.g. INT64
- optional, argument type enclosed in [], e.g. INT64
- repeated, argument type enclosed in [] with ..., e.g. [INT64, ...]
type FunctionArgumentTypeOptions ¶ added in v0.5.0
type FunctionArgumentTypeOptions struct {
// contains filtered or unexported fields
}
FunctionArgumentTypeOptions specifies options on a function argument, including argument cardinality. This includes some options that are used to specify argument values that are illegal and should cause an analysis error.
func NewFunctionArgumentTypeOptions ¶ added in v0.5.0
func NewFunctionArgumentTypeOptions(cardinality ArgumentCardinality) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) ArgumentCollationMode ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ArgumentCollationMode() ArgumentCollationMode
func (*FunctionArgumentTypeOptions) ArgumentName ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ArgumentName() string
func (*FunctionArgumentTypeOptions) ArgumentNameIsMandatory ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ArgumentNameIsMandatory() bool
func (*FunctionArgumentTypeOptions) ArgumentNameParseLocation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ArgumentNameParseLocation() *ParseLocationRange
ArgumentNameParseLocation gets the ParseLocationRange of the argument name.
func (*FunctionArgumentTypeOptions) ArgumentTypeParseLocation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ArgumentTypeParseLocation() *ParseLocationRange
ArgumentTypeParseLocation gets the ParseLocationRange of the argument type.
func (*FunctionArgumentTypeOptions) Cardinality ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) Cardinality() ArgumentCardinality
func (*FunctionArgumentTypeOptions) ClearDefault ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ClearDefault() *FunctionArgumentTypeOptions
ClearDefault clears the default argument value set to this object.
func (*FunctionArgumentTypeOptions) Default ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) Default() Value
Default gets the default value of this argument.
func (*FunctionArgumentTypeOptions) ExtraRelationInputColumnsAllowed ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ExtraRelationInputColumnsAllowed() bool
func (*FunctionArgumentTypeOptions) HasArgumentName ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) HasArgumentName() bool
func (*FunctionArgumentTypeOptions) HasDefault ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) HasDefault() bool
HasDefault returns true if a default value has been defined for this argument.
func (*FunctionArgumentTypeOptions) HasMaxValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) HasMaxValue() bool
func (*FunctionArgumentTypeOptions) HasMinValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) HasMinValue() bool
func (*FunctionArgumentTypeOptions) HasRelationInputSchema ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) HasRelationInputSchema() bool
func (*FunctionArgumentTypeOptions) IsNotAggregate ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) IsNotAggregate() bool
func (*FunctionArgumentTypeOptions) MaxValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MaxValue() int64
func (*FunctionArgumentTypeOptions) MinValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MinValue() int64
func (*FunctionArgumentTypeOptions) MustBeConstant ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MustBeConstant() bool
func (*FunctionArgumentTypeOptions) MustBeNonNull ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MustBeNonNull() bool
func (*FunctionArgumentTypeOptions) MustSupportEquality ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MustSupportEquality() bool
func (*FunctionArgumentTypeOptions) MustSupportGrouping ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MustSupportGrouping() bool
func (*FunctionArgumentTypeOptions) MustSupportOrdering ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) MustSupportOrdering() bool
func (*FunctionArgumentTypeOptions) OptionsDebugString ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) OptionsDebugString() string
OptionsDebugString return a string describing the options (not including cardinality). If no options are set, this returns an empty string. Otherwise, includes a leading space.
func (*FunctionArgumentTypeOptions) ProcedureArgumentMode ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ProcedureArgumentMode() ProcedureArgumentMode
func (*FunctionArgumentTypeOptions) ResolveDescriptorNamesTableOffset ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) ResolveDescriptorNamesTableOffset() int
func (*FunctionArgumentTypeOptions) SQLDeclaration ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SQLDeclaration(mode ProductMode) string
SQLDeclaration get the SQL declaration for these options. The result is formatted as SQL that can be included inside a function signature in CREATE FUNCTION, DROP FUNCTION, etc, if possible.
func (*FunctionArgumentTypeOptions) SetArgumentCollationMode ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetArgumentCollationMode(mode ArgumentCollationMode) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetArgumentName ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetArgumentName(name string) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetArgumentNameIsMandatory ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetArgumentNameIsMandatory(value bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetArgumentNameParseLocation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetArgumentNameParseLocation(locRange *ParseLocationRange) *FunctionArgumentTypeOptions
SetArgumentNameParseLocation sets the ParseLocationRange of the argument name.
func (*FunctionArgumentTypeOptions) SetArgumentTypeParseLocation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetArgumentTypeParseLocation(locRange *ParseLocationRange) *FunctionArgumentTypeOptions
SetArgumentTypeParseLocation sets the ParseLocationRange of the argument type.
func (*FunctionArgumentTypeOptions) SetCardinality ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetCardinality(c ArgumentCardinality) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetDefault ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetDefault(value Value) *FunctionArgumentTypeOptions
SetDefault sets the default value of this argument. Only optional arguments can (optionally) have default values. Restrictions on the default values:
- For fixed-typed arguments, the type of <default_value> must be Equals to the type of the argument.
- Non-expression-typed templated arguments (e.g., tables, connections, models, etc.) cannot have default values.
Note that (in the near future), an optional argument that has a default value and is omitted in a function call will be resolved as if the default value is specified.
Also note that the type of <default_value> must outlive this object as well as all the FunctionSignature instances created using this object.
func (*FunctionArgumentTypeOptions) SetExtraRelationInputColumnsAllowed ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetExtraRelationInputColumnsAllowed(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetIsNotAggregate ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetIsNotAggregate(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMaxValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMaxValue(v int64) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMinValue ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMinValue(v int64) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMustBeConstant ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMustBeConstant(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMustBeNonNull ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMustBeNonNull(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMustSupportEquality ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMustSupportEquality(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMustSupportGrouping ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMustSupportGrouping(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetMustSupportOrdering ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetMustSupportOrdering(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetProcedureArgumentMode ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetProcedureArgumentMode(mode ProcedureArgumentMode) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetResolveDescriptorNamesTableOffset ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetResolveDescriptorNamesTableOffset(tableOffset int) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) SetUsesArrayElementForCollation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) SetUsesArrayElementForCollation(v bool) *FunctionArgumentTypeOptions
func (*FunctionArgumentTypeOptions) UsesArrayElementForCollation ¶ added in v0.5.0
func (o *FunctionArgumentTypeOptions) UsesArrayElementForCollation() bool
type FunctionSignature ¶
type FunctionSignature struct {
// contains filtered or unexported fields
}
FunctionSignature identifies the argument Types and other properties per overload of a Function (or a similar object, like a Procedure or TableValuedFunction). A FunctionSignature is concrete if it identifies the exact number and fixed Types of its arguments and results. A FunctionSignature can be non-concrete, but have concrete arguments. A FunctionSignature can be abstract, specifying templated types and identifying arguments as repeated or optional. Optional arguments must appear at the end of the argument list.
If multiple arguments are repeated, they must be consecutive and are treated as if they repeat together. To illustrate, consider the expression: 'CASE WHEN <bool_expr_1> THEN <expr_1>
WHEN <bool_expr_2> THEN <expr_2> ... ELSE <expr_n> END'.
This expression has the following signature <arguments>:
arg1: <bool> repeated - WHEN arg2: <any_type_1> repeated - THEN arg3: <any_type_1> optional - ELSE result: <any_type_1>
The WHEN and THEN arguments (arg1 and arg2) repeat together and must occur at least once, and the ELSE is optional. The THEN, ELSE, and RESULT types can be any type, but must be the same type.
In order to avoid potential ambiguity, the number of optional arguments must be less than the number of repeated arguments.
The FunctionSignature also includes <options> for specifying additional signature matching requirements, if any.
func NewFunctionSignature ¶ added in v0.2.5
func NewFunctionSignature(resultType *FunctionArgumentType, args []*FunctionArgumentType) *FunctionSignature
func (*FunctionSignature) AllArgumentsHaveDefaults ¶
func (s *FunctionSignature) AllArgumentsHaveDefaults() bool
Returns true if all the arguments in the signature have default values. Note this function returns true when the signature has no arguments.
func (*FunctionSignature) Arguments ¶
func (s *FunctionSignature) Arguments() []*FunctionArgumentType
func (*FunctionSignature) ConcreteArguments ¶
func (s *FunctionSignature) ConcreteArguments() []*FunctionArgumentType
ConcreteArguments returns concrete argument. Differs from argments above in that repeated and optional arguments are fully expanded in a concrete signature. Requires that the signature has concrete arguments.
func (*FunctionSignature) DebugString ¶
func (s *FunctionSignature) DebugString(functionName string, verbose bool) string
DebugString if verbose is true, include FunctionOptions modifiers.
func (*FunctionSignature) FirstRepeatedArgumentIndex ¶
func (s *FunctionSignature) FirstRepeatedArgumentIndex() int
FirstRepeatedArgumentIndex gets the first repeated argument index. If there are no repeated arguments then returns -1.
func (*FunctionSignature) HasConcreteArguments ¶
func (s *FunctionSignature) HasConcreteArguments() bool
HasConcreteArguments returns TRUE if all arguments are concrete.
func (*FunctionSignature) IsConcrete ¶
func (s *FunctionSignature) IsConcrete() bool
func (*FunctionSignature) IsDeprecated ¶
func (s *FunctionSignature) IsDeprecated() bool
func (*FunctionSignature) IsInternal ¶
func (s *FunctionSignature) IsInternal() bool
func (*FunctionSignature) IsTemplated ¶
func (s *FunctionSignature) IsTemplated() bool
IsTemplated returns true if this function signature contains any templated arguments.
func (*FunctionSignature) IsValid ¶
func (s *FunctionSignature) IsValid(mode ProductMode) error
IsValid determines whether the argument and result types are valid. Additionally, it requires that all repeated arguments are consecutive, and all optional arguments appear at the end. There may be required arguments before the repeated arguments, and there may be required arguments between the repeated and optional arguments.
func (*FunctionSignature) IsValidForFunction ¶
func (s *FunctionSignature) IsValidForFunction() error
IsValidForFunction checks specific invariants for the argument and return types for regular function calls. The latter may use relation types (returning true for (*FunctionArgumentType).IsRelation()) but the former may not.
func (*FunctionSignature) IsValidForProcedure ¶
func (s *FunctionSignature) IsValidForProcedure() error
IsValidForProcedure checks if this signature is valid for Procedure. Procedure may only have fixed required arguments.
func (*FunctionSignature) IsValidForTableValuedFunction ¶
func (s *FunctionSignature) IsValidForTableValuedFunction() error
IsValidForTableValuedFunction checks specific invariants for the argument and return types for table-valued function calls. The latter may use relation types (returning true for (*FunctionArgumentType).IsRelation()) but the former may not.
func (*FunctionSignature) LastRepeatedArgumentIndex ¶
func (s *FunctionSignature) LastRepeatedArgumentIndex() int
LastRepeatedArgumentIndex gets the first repeated argument index. If there are no repeated arguments then returns -1.
func (*FunctionSignature) NumOptionalArguments ¶
func (s *FunctionSignature) NumOptionalArguments() int
NumOptionalArguments gets the number of optional arguments.
func (*FunctionSignature) NumRepeatedArguments ¶
func (s *FunctionSignature) NumRepeatedArguments() int
NumRepeatedArguments gets the number of repeated arguments.
func (*FunctionSignature) NumRequiredArguments ¶
func (s *FunctionSignature) NumRequiredArguments() int
NumRequiredArguments gets the number of required arguments.
func (*FunctionSignature) Options ¶
func (s *FunctionSignature) Options() *FunctionSignatureOptions
func (*FunctionSignature) ResultType ¶
func (s *FunctionSignature) ResultType() *FunctionArgumentType
func (*FunctionSignature) SQLDeclaration ¶
func (s *FunctionSignature) SQLDeclaration(argumentNames []string, mode ProductMode) string
SQLDeclaration get the SQL declaration for this signature, including all options. For each argument in the signature, the name will be taken from the corresponding entry of <argument_names> if present. An empty <argument_names> will result in a signature with just type names. The result is formatted as "(arg_name type, ...) RETURNS type", which is valid to use in CREATE FUNCTION, DROP FUNCTION, etc, if possible.
func (*FunctionSignature) SetConcreteResultType ¶
func (s *FunctionSignature) SetConcreteResultType(typ Type)
func (*FunctionSignature) SetIsDeprecated ¶
func (s *FunctionSignature) SetIsDeprecated(v bool)
type FunctionSignatureOptions ¶
type FunctionSignatureOptions struct {
// contains filtered or unexported fields
}
type ParseLocationPoint ¶ added in v0.3.7
type ParseLocationPoint struct {
// contains filtered or unexported fields
}
func (*ParseLocationPoint) ByteOffset ¶ added in v0.3.7
func (p *ParseLocationPoint) ByteOffset() int
func (*ParseLocationPoint) Filename ¶ added in v0.3.7
func (p *ParseLocationPoint) Filename() string
func (*ParseLocationPoint) String ¶ added in v0.3.7
func (p *ParseLocationPoint) String() string
type ParseLocationRange ¶ added in v0.3.7
type ParseLocationRange struct {
// contains filtered or unexported fields
}
func (*ParseLocationRange) End ¶ added in v0.3.7
func (r *ParseLocationRange) End() *ParseLocationPoint
func (*ParseLocationRange) Start ¶ added in v0.3.7
func (r *ParseLocationRange) Start() *ParseLocationPoint
func (*ParseLocationRange) String ¶ added in v0.3.7
func (r *ParseLocationRange) String() string
type Procedure ¶
type Procedure struct {
// contains filtered or unexported fields
}
func NewProcedure ¶ added in v0.2.5
func NewProcedure(namePath []string, signature *FunctionSignature) *Procedure
func (*Procedure) Signature ¶
func (p *Procedure) Signature() *FunctionSignature
func (*Procedure) SupportedSignatureUserFacingText ¶
func (p *Procedure) SupportedSignatureUserFacingText(mode ProductMode) string
type ProcedureArgumentMode ¶ added in v0.5.0
type ProcedureArgumentMode int
const ( NotSetProcedureArgumentMode ProcedureArgumentMode = 0 InProcedureArgumentMode ProcedureArgumentMode = 1 OutProcedureArgumentMode ProcedureArgumentMode = 2 InOutProcedureArgumentMode ProcedureArgumentMode = 3 )
type ProductMode ¶
type ProductMode int
ProductMode this identifies whether ZetaSQL works in INTERNAL (inside Google) mode, or in EXTERNAL (exposed to non-Googlers in the products such as Cloud).
const ( ProductInternal ProductMode = 0 ProductExternal ProductMode = 1 )
type SQLTableValuedFunction ¶ added in v0.2.5
type SQLTableValuedFunction struct {
*BaseTableValuedFunction
}
func NewSQLTableValuedFunction ¶ added in v0.2.5
func NewSQLTableValuedFunction(createTableFunctionStmtPtr unsafe.Pointer) (*SQLTableValuedFunction, error)
type SignatureArgumentKind ¶
type SignatureArgumentKind int
const ( // ArgTypeFixed a specific concrete Type. ArgTypeFixed SignatureArgumentKind = 0 // ArgTypeAny1 templated type. All arguments with this type must be the same type. // For example, // IF <bool> THEN <T1> ELSE <T1> END -> <T1> ArgTypeAny1 SignatureArgumentKind = 1 // ArgTypeAny2 templated type. All arguments with this type must be the same type. // For example, // CASE <T1> WHEN <T1> THEN <T2> // WHEN <T1> THEN <T2> ELSE <T2> END -> <T2> ArgTypeAny2 SignatureArgumentKind = 2 // ArgArrayTypeAny1 templated array type. All arguments with this type must be the same // type. Additionally, all arguments with this type must be an array // whose element type matches arguments with ARG_TYPE_ANY_1 type. // For example, // FIRST(<array<T1>>) -> <T1> ArgArrayTypeAny1 SignatureArgumentKind = 3 // ArgArrayTypeAny2 templated array type. All arguments with this type must be the same // type. Additionally, all arguments with this type must be an array // whose element type matches arguments with ARG_TYPE_ANY_2 type. // For example, // LAST(<array<T2>>) -> <T2> ArgArrayTypeAny2 SignatureArgumentKind = 4 // ArgProtoAny templated proto type. All arguments with this type must be the same type. // e.g.: // DEBUGSTRING(<proto>) -> <string> ArgProtoAny SignatureArgumentKind = 5 // ArgStructAny templated struct type. All arguments with this type must be the same type. // e.g.: // DEBUGSTRING(<struct>) -> <string> ArgStructAny SignatureArgumentKind = 6 // ArgEnumAny templated enum type. All arguments with this type must be the same type. // e.g.: // ENUM_NAME(<enum>, 5) -> <string> ArgEnumAny SignatureArgumentKind = 7 // ArgTypeArbitrary arbitrary Type. Multiple arguments with this type do not need to be the // same type. This does not include relation arguments. ArgTypeArbitrary SignatureArgumentKind = 8 // ArgTypeRelation relation type. This is only valid for table-valued functions (TVFs). This // specifies a relation of any number and types of columns. Multiple arguments // with this type do not necessarily represent the same relation. // // Background: each TVF may accept value or relation arguments. The signature // specifies whether each argument should be a value or a relation. For a // value argument, the signature may use one of the other // SignatureArgumentKinds in this list. // // For more information, please see table_valued_function.h. ArgTypeRelation SignatureArgumentKind = 9 // ArgTypeVoid this is used for a non-existent return type for signatures that do not // return a value. This can only be used as a return type, and only in // contexts where there is no return (e.g. Procedures, or signatures in DropFunctionStmtNode). ArgTypeVoid SignatureArgumentKind = 10 // ArgTypeModel model type. This is only valid for table-valued functions (TVFs). This // specifies a model for ML-related TVFs. ArgTypeModel SignatureArgumentKind = 11 // ArgTypeConnection connection type. This is only valid for table-valued functions (TVFs). This // specifies a connection for EXTERNAL_QUERY TVF. ArgTypeConnection SignatureArgumentKind = 12 // ArgTypeDescriptor descriptor type. This is only valid for table-valued functions (TVFs). This // specifies a descriptor with a list of column names. ArgTypeDescriptor SignatureArgumentKind = 13 // ArgProtoMapAny templated proto map type. This is an array of protos where the proto // is a map entry. It has a key field and a value field. This kind allows // inference of the key and value field types from the map field type, as // in this expression: // // ARG_PROTO_MAP_ANY[KEY(ARG_PROTO_MAP_KEY_ANY)] -> // ARG_PROTO_MAP_VALUE_ANY ArgProtoMapAny SignatureArgumentKind = 14 // ArgProtoMapKeyAny the key type of a proto map that matches ARG_PROTO_MAP_ANY. ArgProtoMapKeyAny SignatureArgumentKind = 15 // ArgProtoMapValueAny the value type of a proto map that matches ARG_PROTO_MAP_ANY. ArgProtoMapValueAny SignatureArgumentKind = 16 // ArgTypeLambda lambda type. This is only valid for lambda function arguments. This // specifies a lambda with a list of argument types and a body type. ArgTypeLambda SignatureArgumentKind = 17 )
type SimpleCatalog ¶
type SimpleCatalog struct {
*BaseEnumerableCatalog
}
func NewSimpleCatalog ¶
func NewSimpleCatalog(name string) *SimpleCatalog
func (*SimpleCatalog) AddCatalog ¶
func (c *SimpleCatalog) AddCatalog(catalog Catalog)
func (*SimpleCatalog) AddCatalogWithName ¶
func (c *SimpleCatalog) AddCatalogWithName(name string, catalog Catalog)
func (*SimpleCatalog) AddConnection ¶
func (c *SimpleCatalog) AddConnection(conn Connection)
func (*SimpleCatalog) AddConnectionWithName ¶
func (c *SimpleCatalog) AddConnectionWithName(name string, conn Connection)
func (*SimpleCatalog) AddConstant ¶
func (c *SimpleCatalog) AddConstant(cons Constant)
func (*SimpleCatalog) AddConstantWithName ¶
func (c *SimpleCatalog) AddConstantWithName(name string, cons Constant)
func (*SimpleCatalog) AddFunction ¶
func (c *SimpleCatalog) AddFunction(fn *Function)
func (*SimpleCatalog) AddFunctionWithName ¶
func (c *SimpleCatalog) AddFunctionWithName(name string, fn *Function)
func (*SimpleCatalog) AddModel ¶
func (c *SimpleCatalog) AddModel(model Model)
func (*SimpleCatalog) AddModelWithName ¶
func (c *SimpleCatalog) AddModelWithName(name string, model Model)
func (*SimpleCatalog) AddProcedure ¶
func (c *SimpleCatalog) AddProcedure(proc *Procedure)
func (*SimpleCatalog) AddProcedureWithName ¶
func (c *SimpleCatalog) AddProcedureWithName(name string, proc *Procedure)
func (*SimpleCatalog) AddTable ¶
func (c *SimpleCatalog) AddTable(table Table)
func (*SimpleCatalog) AddTableValuedFunction ¶
func (c *SimpleCatalog) AddTableValuedFunction(fn TableValuedFunction)
func (*SimpleCatalog) AddTableValuedFunctionWithName ¶
func (c *SimpleCatalog) AddTableValuedFunctionWithName(name string, fn TableValuedFunction)
func (*SimpleCatalog) AddTableWithName ¶
func (c *SimpleCatalog) AddTableWithName(name string, table Table)
func (*SimpleCatalog) AddType ¶
func (c *SimpleCatalog) AddType(name string, typ Type)
func (*SimpleCatalog) AddTypeIfNotPresent ¶
func (c *SimpleCatalog) AddTypeIfNotPresent(name string, typ Type) bool
func (*SimpleCatalog) AddZetaSQLBuiltinFunctions ¶
func (c *SimpleCatalog) AddZetaSQLBuiltinFunctions(opt *BuiltinFunctionOptions)
func (*SimpleCatalog) Catalog ¶
func (c *SimpleCatalog) Catalog(name string) (*SimpleCatalog, error)
func (*SimpleCatalog) CatalogNames ¶
func (c *SimpleCatalog) CatalogNames() []string
func (*SimpleCatalog) Catalogs ¶
func (c *SimpleCatalog) Catalogs() ([]Catalog, error)
func (*SimpleCatalog) Connection ¶
func (c *SimpleCatalog) Connection(name string) (Connection, error)
func (*SimpleCatalog) ConstantNames ¶
func (c *SimpleCatalog) ConstantNames() []string
func (*SimpleCatalog) Constants ¶
func (c *SimpleCatalog) Constants() ([]Constant, error)
func (*SimpleCatalog) FunctionNames ¶
func (c *SimpleCatalog) FunctionNames() []string
func (*SimpleCatalog) Functions ¶
func (c *SimpleCatalog) Functions() ([]*Function, error)
func (*SimpleCatalog) Procedure ¶
func (c *SimpleCatalog) Procedure(name string) (*Procedure, error)
func (*SimpleCatalog) Procedures ¶
func (c *SimpleCatalog) Procedures() []*Procedure
func (*SimpleCatalog) TableNames ¶
func (c *SimpleCatalog) TableNames() []string
func (*SimpleCatalog) TableValuedFunction ¶
func (c *SimpleCatalog) TableValuedFunction(name string) (TableValuedFunction, error)
func (*SimpleCatalog) TableValuedFunctionNames ¶
func (c *SimpleCatalog) TableValuedFunctionNames() []string
func (*SimpleCatalog) TableValuedFunctions ¶
func (c *SimpleCatalog) TableValuedFunctions() []TableValuedFunction
func (*SimpleCatalog) Tables ¶
func (c *SimpleCatalog) Tables() ([]Table, error)
func (*SimpleCatalog) Types ¶
func (c *SimpleCatalog) Types() ([]Type, error)
type SimpleColumn ¶
type SimpleColumn struct {
*BaseColumn
}
func NewSimpleColumn ¶
func NewSimpleColumn(tableName, name string, typ Type) *SimpleColumn
func NewSimpleColumnWithOpt ¶
func NewSimpleColumnWithOpt(tableName, name string, typ Type, isPseudoColumn, isWritableColumn bool) *SimpleColumn
func (*SimpleColumn) AnnotatedType ¶
func (c *SimpleColumn) AnnotatedType() *AnnotatedType
func (*SimpleColumn) SetIsPseudoColumn ¶
func (c *SimpleColumn) SetIsPseudoColumn(v bool)
type SimpleModel ¶ added in v0.2.5
type SimpleModel struct {
*BaseModel
}
func NewSimpleModel ¶ added in v0.2.5
func NewSimpleModel(name string, inputs []Column, outputs []Column) *SimpleModel
func (*SimpleModel) AddInput ¶ added in v0.2.5
func (m *SimpleModel) AddInput(column Column) error
func (*SimpleModel) AddOutput ¶ added in v0.2.5
func (m *SimpleModel) AddOutput(column Column) error
type SimpleTable ¶
type SimpleTable struct {
*BaseTable
}
func NewSimpleTable ¶
func NewSimpleTable(name string, columns []Column) *SimpleTable
func (*SimpleTable) AddColumn ¶
func (t *SimpleTable) AddColumn(col Column) error
func (*SimpleTable) AllowAnonymousColumnName ¶
func (t *SimpleTable) AllowAnonymousColumnName() bool
func (*SimpleTable) AllowDuplicateColumnNames ¶
func (t *SimpleTable) AllowDuplicateColumnNames() bool
func (*SimpleTable) SetAllowAnonymousColumnName ¶
func (t *SimpleTable) SetAllowAnonymousColumnName(value bool) error
func (*SimpleTable) SetAllowDuplicateColumnNames ¶
func (t *SimpleTable) SetAllowDuplicateColumnNames(value bool) error
func (*SimpleTable) SetFullName ¶
func (t *SimpleTable) SetFullName(fullName string) error
func (*SimpleTable) SetIsValueTable ¶
func (t *SimpleTable) SetIsValueTable(value bool)
func (*SimpleTable) SetPrimaryKey ¶
func (t *SimpleTable) SetPrimaryKey(primaryKey []int) error
type StructAnnotationMap ¶
type StructAnnotationMap struct {
*BaseAnnotationMap
}
type StructField ¶
type StructField struct {
// contains filtered or unexported fields
}
func NewStructField ¶
func NewStructField(name string, typ Type) *StructField
func (*StructField) Name ¶
func (f *StructField) Name() string
func (*StructField) Type ¶
func (f *StructField) Type() Type
type StructType ¶
type StructType struct {
// contains filtered or unexported fields
}
func NewStructType ¶
func NewStructType(fields []*StructField) (*StructType, error)
func (StructType) AsStruct ¶ added in v0.2.5
func (t StructType) AsStruct() *StructType
func (StructType) DebugString ¶
func (StructType) Equivalent ¶
func (*StructType) Field ¶
func (t *StructType) Field(i int) *StructField
func (*StructType) Fields ¶
func (t *StructType) Fields() []*StructField
func (StructType) HasAnyFields ¶
func (t StructType) HasAnyFields() bool
func (StructType) IsBigNumericType ¶
func (t StructType) IsBigNumericType() bool
func (StructType) IsCivilDateOrTimeType ¶
func (t StructType) IsCivilDateOrTimeType() bool
func (StructType) IsDatetime ¶
func (t StructType) IsDatetime() bool
func (StructType) IsExtendedType ¶
func (t StructType) IsExtendedType() bool
func (StructType) IsFeatureV12CivilTimeType ¶
func (t StructType) IsFeatureV12CivilTimeType() bool
func (StructType) IsFloatingPoint ¶
func (t StructType) IsFloatingPoint() bool
func (StructType) IsGeography ¶
func (t StructType) IsGeography() bool
func (StructType) IsInteger32 ¶
func (t StructType) IsInteger32() bool
func (StructType) IsInteger64 ¶
func (t StructType) IsInteger64() bool
func (StructType) IsInterval ¶
func (t StructType) IsInterval() bool
func (StructType) IsJsonType ¶
func (t StructType) IsJsonType() bool
func (StructType) IsNumericType ¶
func (t StructType) IsNumericType() bool
func (StructType) IsNumerical ¶
func (t StructType) IsNumerical() bool
func (StructType) IsSignedInteger ¶
func (t StructType) IsSignedInteger() bool
func (StructType) IsSimpleType ¶
func (t StructType) IsSimpleType() bool
func (StructType) IsStructOrProto ¶
func (t StructType) IsStructOrProto() bool
func (StructType) IsTimestamp ¶
func (t StructType) IsTimestamp() bool
func (StructType) IsUnsignedInteger ¶
func (t StructType) IsUnsignedInteger() bool
func (StructType) NestingDepth ¶
func (t StructType) NestingDepth() int
func (*StructType) NumFields ¶
func (t *StructType) NumFields() int
func (StructType) ShortTypeName ¶
func (t StructType) ShortTypeName(mode ProductMode) string
func (StructType) SupportsEquality ¶
func (t StructType) SupportsEquality() bool
func (StructType) SupportsGrouping ¶
func (t StructType) SupportsGrouping() bool
func (StructType) SupportsOrdering ¶
func (t StructType) SupportsOrdering() bool
func (StructType) SupportsPartitioning ¶
func (t StructType) SupportsPartitioning() bool
func (StructType) TypeName ¶
func (t StructType) TypeName(mode ProductMode) string
func (StructType) TypeNameWithParameters ¶
func (t StructType) TypeNameWithParameters(param *TypeParameters, mode ProductMode) (string, error)
func (StructType) UsingFeatureV12CivilTimeType ¶
func (t StructType) UsingFeatureV12CivilTimeType() bool
func (StructType) ValidateAndResolveTypeParameters ¶
func (t StructType) ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error)
func (StructType) ValidateResolvedTypeParameters ¶
func (t StructType) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error
type TVFSignature ¶
type TVFSignature struct {
// contains filtered or unexported fields
}
TVFSignature contains information about a specific resolved TVF call. It includes the input arguments passed into the TVF call and also its output schema (including whether it is a value table). Engines may also subclass this to include more information if needed.
type Table ¶
type Table interface { Name() string FullName() string NumColumns() int Column(int) Column PrimaryKey() []int FindColumnByName(name string) Column IsValueTable() bool SerializationID() int64 CreateEvaluatorTableIterator(columnIdxs []int) (*EvaluatorTableIterator, error) AnonymizationInfo() *AnonymizationInfo SupportsAnonymization() bool TableTypeName(mode ProductMode) string }
type TableValuedFunction ¶
type TableValuedFunction interface { Name() string FullName() string FunctionNamePath() []string NumSignatures() int64 Signatures() []*FunctionSignature AddSignature(*FunctionSignature) error Signature(int64) *FunctionSignature SupportedSignaturesUserFacingText() string DebugString() string SetUserIdColumnNamePath(path []string) error AnonymizationInfo() *AnonymizationInfo // contains filtered or unexported methods }
TableValuedFunction this interface describes a table-valued function (TVF) available in a query engine.
For reference, each call to the regular Function class:
- accepts value (not relation) arguments only,
- has a fixed list of (maybe templated) signatures and the function resolver selects one concrete signature,
- returns a single value.
In contrast, each TVF call:
- accepts scalar or relation arguments,
- has a single signature specifying the types of input arguments,
- returns a stream of rows,
- has an output table schema (column names and types, or a value table) computed by a method in this class, and not described in the signature.
To resolve a TVF call, the resolver:
(1) gets the signature (currently, only one signature is supported) (2) resolves all input arguments as values or as relations based on the
signature
(3) prepares a TableValuedFunction.InputArgumentList from the resolved input
arguments
(4) calls TableValuedFunction.Resolve, passing the input arguments, to get
a TableValuedFunctionCall object with the output schema for the TVF call
(5) fills the output name list from the column names in the output schema (6) returns a TVFScanNode with the resolved arguments as children
type Type ¶
type Type interface { Kind() TypeKind IsInt32() bool IsInt64() bool IsUint32() bool IsUint64() bool IsBool() bool IsFloat() bool IsDouble() bool IsString() bool IsBytes() bool IsDate() bool IsTimestamp() bool IsTime() bool IsDatetime() bool IsInterval() bool IsNumericType() bool IsBigNumericType() bool IsJsonType() bool IsFeatureV12CivilTimeType() bool UsingFeatureV12CivilTimeType() bool IsCivilDateOrTimeType() bool IsGeography() bool IsJson() bool IsEnum() bool IsArray() bool IsStruct() bool IsProto() bool IsStructOrProto() bool IsFloatingPoint() bool IsNumerical() bool IsInteger() bool IsInteger32() bool IsInteger64() bool IsSignedInteger() bool IsUnsignedInteger() bool IsSimpleType() bool IsExtendedType() bool AsArray() *ArrayType AsStruct() *StructType AsEnum() *EnumType SupportsGrouping() bool SupportsPartitioning() bool SupportsOrdering() bool SupportsEquality() bool Equals(Type) bool Equivalent(Type) bool ShortTypeName(ProductMode) string TypeName(ProductMode) string TypeNameWithParameters(*TypeParameters, ProductMode) (string, error) DebugString(details bool) string HasAnyFields() bool NestingDepth() int ValidateAndResolveTypeParameters(values []TypeParameterValue, mode ProductMode) (*TypeParameters, error) ValidateResolvedTypeParameters(params *TypeParameters, mode ProductMode) error // contains filtered or unexported methods }
func BigNumericType ¶
func BigNumericType() Type
func DatetimeType ¶
func DatetimeType() Type
func DoubleType ¶
func DoubleType() Type
func EmptyStructType ¶
func EmptyStructType() Type
func GeographyType ¶
func GeographyType() Type
func IntervalType ¶
func IntervalType() Type
func NumericType ¶
func NumericType() Type
func StringType ¶
func StringType() Type
func TimestampType ¶
func TimestampType() Type
func TypeFromKind ¶
func Uint32Type ¶
func Uint32Type() Type
func Uint64Type ¶
func Uint64Type() Type
type TypeListView ¶
type TypeListView = TypeList
type TypeParameterValue ¶
type TypeParameterValue struct {
// contains filtered or unexported fields
}
type TypeParameters ¶
type TypeParameters struct {
// contains filtered or unexported fields
}
type Value ¶
type Value interface { // Type returns the type of the value. Type() Type // TypeKind returns the type kind of the value. TypeKind() TypeKind // PhysicalByteSize returns the estimated size of the in-memory C++ representation of this value. PhysicalByteSize() uint64 // IsNull returns true if the value is null. IsNull() bool // IsEmptyArray returns true if the value is an empty array. IsEmptyArray() bool // IsValid returns true if the value is valid (invalid values are created by the default constructor). IsValid() bool // HasContent returns true if the Value is valid and non-null. HasContent() bool // Int32Value REQUIRES: int32 type Int32Value() int32 // Int64Value REQUIRES: int64 type Int64Value() int64 // Uint32Value REQUIRES: uint32 type Uint32Value() uint32 // Uint64Value REQUIRES: uint64 type Uint64Value() uint64 // BoolValue REQUIRES: bool type BoolValue() bool // FloatValue REQUIRES: float type FloatValue() float32 // DoubleValue REQUIRES: double type DoubleValue() float64 // StringValue REQUIRES: string type StringValue() string // BytesValue REQUIRES: bytes type BytesValue() []byte // DateValue REQUIRES: date type DateValue() int32 // EnumValue REQUIRES: enum type EnumValue() int32 // EnumName REQUIRES: enum type EnumName() string // ToTime REQUIRES: timestamp type ToTime() time.Time // ToUnixMicros returns timestamp value as Unix epoch microseconds. REQUIRES: timestamp type ToUnixMicros() int64 // ToUnixNanos returns timestamp value as Unix epoch nanoseconds or an error if the value // does not fit into an int64. REQUIRES: timestamp type ToUnixNanos() (int64, error) // ToPacked64TimeMicros REQUIRES: time type. ToPacked64TimeMicros() int64 // ToPacked64DatetimeMicros REQUIRES: datetime type. ToPacked64DatetimeMicros() int64 // IsValidatedJSON checks whether the value belongs to the JSON type, non-NULL and is in // validated representation. JSON values can be in one of the two // representations: // 1) Validated: JSON is parsed, validated and transformed into an efficient // (for field read/updates) in-memory representation (field tree) that can // be accessed through json_value() method. ZetaSQL Analyzer uses this // representation by default to represent JSON values (e.g. literals). // 2) Unparsed: string that was not validated and thus potentially can be // an invalid JSON. ZetaSQL Analyzer uses this representation when // LanguageFeature FEATURE_JSON_NO_VALIDATION is enabled. IsValidatedJSON() bool // IsUnparsedJSON returns true if the value belongs to the JSON type, non-null and is in // unparsed representation. See comments to IsValidatedJSON() for more details. IsUnparsedJSON() bool JSONValueUnparsed() string JSONString() string // ToInt64 for bool, int32, int64, date, enum ToInt64() int64 // ToUint64 for bool, uint32, uint64 ToUint64() uint64 ToDouble() float64 // NumFields struct-specific methods. REQUIRES: !IsNull(). NumFields() int Field(int) Value Fields() []Value // FindFieldByName returns the value of the first field with the given 'name'. // If one doesn't exist, returns an invalid value. // Does not find anonymous fields (those with empty names). FindFieldByName(name string) Value // Empty array-specific methods. REQUIRES: !IsNull(). Empty() bool NumElements() int Element(int) Value Elements() []Value // Equals returns true if 'this' equals 'that' or both are null. This is *not* SQL // equality which returns null when either value is null. Returns false if // 'this' and 'that' have different For floating point values, returns // 'true' if both values are NaN of the same type. // For protos, returns true if the protos have the equivalent descriptors // (using Type::Equivalent) and the values are equivalent according to // MessageDifferencer::Equals, using the descriptor from 'this'. Equals(Value) bool // SQLEquals returns the BOOL (possibly NULL) Value of the SQL expression (*this = // that). Handles corner cases involving NULLs and NaNs. Returns an invalid // Value if the value types are not directly comparable (without an implicit // or explicit cast). (For example, INT64 and UINT64 are directly comparable, // but INT64 and INT32 are not comparable without a widening cast.) To be // safe, it is best to only use this method with Types that appear as // arguments to a call to the $equals function in a resolved AST generated by // the resolver. SQLEquals(Value) Value // LessThan when the types of 'this' and 'that' are compatible, this function returns // true when 'this' is smaller than 'that'. When the types of 'this' and // 'that' are not compatible, the behavior is undefined. // // For simple types, this uses '<' operator on native c++ types to compare the // values. A null value is less than any non-null value. This is // *not* SQL inequality. For floating point values, NaN sorts smaller than // any other value including negative infinity. // For struct types, this compares the fields of the STRUCT pairwise in // ordinal order, returns true as soon as LessThan returns true for a field. // For array types, this compares the arrays in lexicographical order. LessThan(Value) bool // SQLLessThan returns the BOOL (possibly NULL) Value of the SQL expression (*this < // that). Handles corner cases involving NULLs, NaNs. Returns an invalid Value // if the value types are not directly comparable (without an implicit or // explicit cast). (For example, INT64 and UINT64 are directly comparable, but // INT64 and INT32 are not comparable without a widening cast.) To be safe, it // is best to only use this method with Types that appear as arguments to a // call to a comparison function ($equals, $less, $less_or_equals, $greater, // or $greater_or_equals) in a resolved AST generated by the resolver. SQLLessThan(Value) Value // HashCode returns the hash code of a value. // // Result is not guaranteed stable across different runs of a program. It is // not cryptographically secure. It should not be used for distributed // coordination, security or storage which requires a stable computation. // // For more background see https://abseil.io/docs/cpp/guides/hash. HashCode() uint64 // ShortDebugString returns printable string for this Value. // Verbose DebugStrings include the type name. ShortDebugString() string FullDebugString() string DebugString() string // Format returns a pretty-printed (e.g. wrapped) string for the value. // Suitable for printing in golden-tests and documentation. Format() string // SQL returns a SQL expression that produces this value. // This is not necessarily a literal since we don't have literal syntax // for all values. // This assumes that any types used in Value can be resolved using the name // returned from type->TypeName(). Returned type names are sensitive to // the SQL ProductMode (INTERNAL or EXTERNAL). // // Note: Arguably, GetSQL() and GetSQLLiteral() don't work quite right for // STRUCTs. In particular, they do not preserve field names in the result // string. For example, if you have a STRUCT value like // STRUCT<a INT64, b STRING>(1, 'a'), and call GetSQL(), the result will // be "(1, 'a')". If we're only interested in the value itself and not the // original type (with named fields) then maybe that's ok. Note that // GetSQLLiteral() is used in ZetaSQL's FORMAT() function implementation // (Format() in zetasql/public_functions/format.cc) so we cannot change // the output without breaking existing ZetaSQL function semantics. SQL(mode ProductMode) string // SQLLiteral returns a SQL expression that is compatible as a literal for this value. // This won't include CASTs except for non-finite floating point values, and // won't necessarily produce the exact same type when parsed on its own, but // it should be the closest SQL literal form for this value. Returned type // names are sensitive to the SQL ProductMode (INTERNAL or EXTERNAL). SQLLiteral(mode ProductMode) string // contains filtered or unexported methods }