parser

package
v3.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateArgument

type AggregateArgument struct {
	Argument    *CaseLiteral // This is used to store either a ScalarArgument or a ColumnArgument as List in the Value
	TableName   string
	ColumnName  string
	ColumnType  types.Type
	ColumnIndex int32
	IsScalar    bool
}

func (*AggregateArgument) GetType added in v3.2.0

func (a *AggregateArgument) GetType() types.Type

type CaseLiteral

type CaseLiteral struct {
	Type           types.Type
	ValueText      string
	Value          expr.Literal
	SubstraitError *SubstraitError
}

type CompactAggregateFuncCall

type CompactAggregateFuncCall struct {
	FuncName      string
	Rows          [][]expr.Literal
	AggregateArgs []*AggregateArgument
}

type FuncOptions

type FuncOptions map[string]string

type SubstraitError

type SubstraitError struct {
	Error string
}

type TestCase

type TestCase struct {
	BaseURI       string
	GroupDesc     string
	FuncName      string
	Args          []*CaseLiteral
	AggregateArgs []*AggregateArgument
	Result        *CaseLiteral
	Options       FuncOptions
	Columns       [][]expr.Literal
	TableName     string
	ColumnTypes   []types.Type
	FuncType      TestFuncType
}

func (*TestCase) CompoundFunctionName

func (tc *TestCase) CompoundFunctionName() string

func (*TestCase) GetAggregateFunctionInvocation added in v3.2.0

func (tc *TestCase) GetAggregateFunctionInvocation(reg *expr.ExtensionRegistry, funcRegistry functions.FunctionRegistry) (*expr.AggregateFunction, error)

func (*TestCase) GetArgTypes added in v3.2.0

func (tc *TestCase) GetArgTypes() []types.Type

func (*TestCase) GetFunctionOptions

func (tc *TestCase) GetFunctionOptions() []*types.FunctionOption

func (*TestCase) GetScalarFunctionInvocation

func (tc *TestCase) GetScalarFunctionInvocation(reg *expr.ExtensionRegistry, funcRegistry functions.FunctionRegistry) (*expr.ScalarFunction, error)

func (*TestCase) ID

func (tc *TestCase) ID() extensions.ID

type TestCaseVisitor

type TestCaseVisitor struct {
	baseparser.FuncTestCaseParserVisitor
	ErrorListener util.VisitErrorListener
	// contains filtered or unexported fields
}

func (*TestCaseVisitor) Visit

func (v *TestCaseVisitor) Visit(tree antlr.ParseTree) interface{}

func (*TestCaseVisitor) VisitAggFuncTestCase

func (v *TestCaseVisitor) VisitAggFuncTestCase(ctx *baseparser.AggFuncTestCaseContext) interface{}

func (*TestCaseVisitor) VisitAggregateFuncArg

func (v *TestCaseVisitor) VisitAggregateFuncArg(ctx *baseparser.AggregateFuncArgContext) interface{}

func (*TestCaseVisitor) VisitAggregateFuncArgs

func (v *TestCaseVisitor) VisitAggregateFuncArgs(ctx *baseparser.AggregateFuncArgsContext) interface{}

func (*TestCaseVisitor) VisitAggregateFuncTestGroup

func (v *TestCaseVisitor) VisitAggregateFuncTestGroup(ctx *baseparser.AggregateFuncTestGroupContext) interface{}

func (*TestCaseVisitor) VisitArgument

func (v *TestCaseVisitor) VisitArgument(ctx *baseparser.ArgumentContext) interface{}

func (*TestCaseVisitor) VisitArguments

func (v *TestCaseVisitor) VisitArguments(ctx *baseparser.ArgumentsContext) interface{}

func (*TestCaseVisitor) VisitBinary

func (v *TestCaseVisitor) VisitBinary(*baseparser.BinaryContext) interface{}

func (*TestCaseVisitor) VisitBoolean

func (v *TestCaseVisitor) VisitBoolean(*baseparser.BooleanContext) interface{}

func (*TestCaseVisitor) VisitBooleanArg

func (v *TestCaseVisitor) VisitBooleanArg(ctx *baseparser.BooleanArgContext) interface{}

func (*TestCaseVisitor) VisitColumnValues

func (v *TestCaseVisitor) VisitColumnValues(ctx *baseparser.ColumnValuesContext) interface{}

func (*TestCaseVisitor) VisitCompactAggregateFuncCall

func (v *TestCaseVisitor) VisitCompactAggregateFuncCall(ctx *baseparser.CompactAggregateFuncCallContext) interface{}

func (*TestCaseVisitor) VisitDataColumn

func (v *TestCaseVisitor) VisitDataColumn(ctx *baseparser.DataColumnContext) interface{}

func (*TestCaseVisitor) VisitDataType

func (v *TestCaseVisitor) VisitDataType(ctx *baseparser.DataTypeContext) interface{}

func (*TestCaseVisitor) VisitDate

func (v *TestCaseVisitor) VisitDate(*baseparser.DateContext) interface{}

func (*TestCaseVisitor) VisitDateArg

func (v *TestCaseVisitor) VisitDateArg(ctx *baseparser.DateArgContext) interface{}

func (*TestCaseVisitor) VisitDecimalArg

func (v *TestCaseVisitor) VisitDecimalArg(ctx *baseparser.DecimalArgContext) interface{}

func (*TestCaseVisitor) VisitDecimalType

func (v *TestCaseVisitor) VisitDecimalType(ctx *baseparser.DecimalTypeContext) interface{}

func (*TestCaseVisitor) VisitDoc

func (v *TestCaseVisitor) VisitDoc(ctx *baseparser.DocContext) interface{}

func (*TestCaseVisitor) VisitFixedBinaryArg

func (v *TestCaseVisitor) VisitFixedBinaryArg(ctx *baseparser.FixedBinaryArgContext) interface{}

func (*TestCaseVisitor) VisitFixedBinaryType

func (v *TestCaseVisitor) VisitFixedBinaryType(ctx *baseparser.FixedBinaryTypeContext) interface{}

func (*TestCaseVisitor) VisitFixedCharArg

func (v *TestCaseVisitor) VisitFixedCharArg(ctx *baseparser.FixedCharArgContext) interface{}

func (*TestCaseVisitor) VisitFixedCharType

func (v *TestCaseVisitor) VisitFixedCharType(ctx *baseparser.FixedCharTypeContext) interface{}

func (*TestCaseVisitor) VisitFloatArg

func (v *TestCaseVisitor) VisitFloatArg(ctx *baseparser.FloatArgContext) interface{}

func (*TestCaseVisitor) VisitFp32

func (v *TestCaseVisitor) VisitFp32(*baseparser.Fp32Context) interface{}

func (*TestCaseVisitor) VisitFp64

func (v *TestCaseVisitor) VisitFp64(*baseparser.Fp64Context) interface{}

func (*TestCaseVisitor) VisitFuncOption

func (v *TestCaseVisitor) VisitFuncOption(ctx *baseparser.FuncOptionContext) interface{}

func (*TestCaseVisitor) VisitFuncOptions

func (v *TestCaseVisitor) VisitFuncOptions(ctx *baseparser.FuncOptionsContext) interface{}

func (*TestCaseVisitor) VisitHeader

func (v *TestCaseVisitor) VisitHeader(ctx *baseparser.HeaderContext) interface{}

func (*TestCaseVisitor) VisitI16

func (v *TestCaseVisitor) VisitI16(*baseparser.I16Context) interface{}

func (*TestCaseVisitor) VisitI32

func (v *TestCaseVisitor) VisitI32(*baseparser.I32Context) interface{}

func (*TestCaseVisitor) VisitI64

func (v *TestCaseVisitor) VisitI64(*baseparser.I64Context) interface{}

func (*TestCaseVisitor) VisitI8

func (v *TestCaseVisitor) VisitI8(*baseparser.I8Context) interface{}

func (*TestCaseVisitor) VisitInclude

func (v *TestCaseVisitor) VisitInclude(ctx *baseparser.IncludeContext) interface{}

func (*TestCaseVisitor) VisitIntArg

func (v *TestCaseVisitor) VisitIntArg(ctx *baseparser.IntArgContext) interface{}

func (*TestCaseVisitor) VisitIntegerLiteral

func (v *TestCaseVisitor) VisitIntegerLiteral(ctx *baseparser.IntegerLiteralContext) interface{}

func (*TestCaseVisitor) VisitIntervalDayArg

func (v *TestCaseVisitor) VisitIntervalDayArg(ctx *baseparser.IntervalDayArgContext) interface{}

func (*TestCaseVisitor) VisitIntervalDayType

func (v *TestCaseVisitor) VisitIntervalDayType(ctx *baseparser.IntervalDayTypeContext) interface{}

func (*TestCaseVisitor) VisitIntervalYear

func (v *TestCaseVisitor) VisitIntervalYear(*baseparser.IntervalYearContext) interface{}

func (*TestCaseVisitor) VisitIntervalYearArg

func (v *TestCaseVisitor) VisitIntervalYearArg(ctx *baseparser.IntervalYearArgContext) interface{}

func (*TestCaseVisitor) VisitList

func (v *TestCaseVisitor) VisitList(ctx *baseparser.ListContext) interface{}

func (*TestCaseVisitor) VisitListArg

func (v *TestCaseVisitor) VisitListArg(ctx *baseparser.ListArgContext) interface{}

func (*TestCaseVisitor) VisitLiteral

func (v *TestCaseVisitor) VisitLiteral(ctx *baseparser.LiteralContext) interface{}

func (*TestCaseVisitor) VisitLiteralList

func (v *TestCaseVisitor) VisitLiteralList(ctx *baseparser.LiteralListContext) interface{}

func (*TestCaseVisitor) VisitMultiArgAggregateFuncCall

func (v *TestCaseVisitor) VisitMultiArgAggregateFuncCall(ctx *baseparser.MultiArgAggregateFuncCallContext) interface{}

func (*TestCaseVisitor) VisitNullArg

func (v *TestCaseVisitor) VisitNullArg(ctx *baseparser.NullArgContext) interface{}

func (*TestCaseVisitor) VisitParameterizedType

func (v *TestCaseVisitor) VisitParameterizedType(ctx *baseparser.ParameterizedTypeContext) interface{}

func (*TestCaseVisitor) VisitPrecisionTimestampTZType

func (v *TestCaseVisitor) VisitPrecisionTimestampTZType(ctx *baseparser.PrecisionTimestampTZTypeContext) interface{}

func (*TestCaseVisitor) VisitPrecisionTimestampType

func (v *TestCaseVisitor) VisitPrecisionTimestampType(ctx *baseparser.PrecisionTimestampTypeContext) interface{}

func (*TestCaseVisitor) VisitQualifiedAggregateFuncArg

func (v *TestCaseVisitor) VisitQualifiedAggregateFuncArg(ctx *baseparser.QualifiedAggregateFuncArgContext) interface{}

func (*TestCaseVisitor) VisitQualifiedAggregateFuncArgs

func (v *TestCaseVisitor) VisitQualifiedAggregateFuncArgs(ctx *baseparser.QualifiedAggregateFuncArgsContext) interface{}

func (*TestCaseVisitor) VisitResult

func (v *TestCaseVisitor) VisitResult(ctx *baseparser.ResultContext) interface{}

func (*TestCaseVisitor) VisitScalarFuncTestGroup

func (v *TestCaseVisitor) VisitScalarFuncTestGroup(ctx *baseparser.ScalarFuncTestGroupContext) interface{}

func (*TestCaseVisitor) VisitSingleArgAggregateFuncCall

func (v *TestCaseVisitor) VisitSingleArgAggregateFuncCall(ctx *baseparser.SingleArgAggregateFuncCallContext) interface{}

func (*TestCaseVisitor) VisitString

func (v *TestCaseVisitor) VisitString(*baseparser.StringContext) interface{}

func (*TestCaseVisitor) VisitStringArg

func (v *TestCaseVisitor) VisitStringArg(ctx *baseparser.StringArgContext) interface{}

func (*TestCaseVisitor) VisitSubstraitError

func (v *TestCaseVisitor) VisitSubstraitError(ctx *baseparser.SubstraitErrorContext) interface{}

func (*TestCaseVisitor) VisitTableData

func (v *TestCaseVisitor) VisitTableData(ctx *baseparser.TableDataContext) interface{}

func (*TestCaseVisitor) VisitTableRows

func (v *TestCaseVisitor) VisitTableRows(ctx *baseparser.TableRowsContext) interface{}

func (*TestCaseVisitor) VisitTestCase

func (v *TestCaseVisitor) VisitTestCase(ctx *baseparser.TestCaseContext) interface{}

func (*TestCaseVisitor) VisitTestGroupDescription

func (v *TestCaseVisitor) VisitTestGroupDescription(ctx *baseparser.TestGroupDescriptionContext) interface{}

func (*TestCaseVisitor) VisitTime

func (v *TestCaseVisitor) VisitTime(*baseparser.TimeContext) interface{}

func (*TestCaseVisitor) VisitTimeArg

func (v *TestCaseVisitor) VisitTimeArg(ctx *baseparser.TimeArgContext) interface{}

func (*TestCaseVisitor) VisitTimestamp

func (v *TestCaseVisitor) VisitTimestamp(*baseparser.TimestampContext) interface{}

func (*TestCaseVisitor) VisitTimestampArg

func (v *TestCaseVisitor) VisitTimestampArg(ctx *baseparser.TimestampArgContext) interface{}

func (*TestCaseVisitor) VisitTimestampTz

func (v *TestCaseVisitor) VisitTimestampTz(*baseparser.TimestampTzContext) interface{}

func (*TestCaseVisitor) VisitTimestampTzArg

func (v *TestCaseVisitor) VisitTimestampTzArg(ctx *baseparser.TimestampTzArgContext) interface{}

func (*TestCaseVisitor) VisitUuid

func (v *TestCaseVisitor) VisitUuid(*baseparser.UuidContext) interface{}

func (*TestCaseVisitor) VisitVarCharArg

func (v *TestCaseVisitor) VisitVarCharArg(ctx *baseparser.VarCharArgContext) interface{}

func (*TestCaseVisitor) VisitVarCharType

func (v *TestCaseVisitor) VisitVarCharType(ctx *baseparser.VarCharTypeContext) interface{}

func (*TestCaseVisitor) VisitVersion

func (v *TestCaseVisitor) VisitVersion(ctx *baseparser.VersionContext) interface{}

type TestFile

type TestFile struct {
	Header    *TestFileHeader
	TestCases []*TestCase
}

func ParseTestCaseFileFromFS

func ParseTestCaseFileFromFS(fs fs.FS, s string) (*TestFile, error)

func ParseTestCasesFromFile

func ParseTestCasesFromFile(input fs.File) (*TestFile, error)

func ParseTestCasesFromString

func ParseTestCasesFromString(input string) (*TestFile, error)

type TestFileHeader

type TestFileHeader struct {
	Version     string
	FuncType    TestFuncType
	IncludedURI string
}

type TestFuncType

type TestFuncType string
const (
	ScalarFuncType    TestFuncType = "scalar"
	AggregateFuncType TestFuncType = "aggregate"
	WindowFuncType    TestFuncType = "window"
)

type TestGroup

type TestGroup struct {
	Description string
	TestCases   []*TestCase
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL