Documentation ¶
Index ¶
- Constants
- type ESql
- func (e *ESql) Convert(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
- func (e *ESql) ConvertPretty(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
- func (e *ESql) ConvertPrettyTemporal(sql string, namespaceID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
- func (e *ESql) ConvertTemporal(sql string, namespaceID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
- func (e *ESql) ProcessQueryKey(filterArg FilterFunc, processArg ProcessFunc)
- func (e *ESql) ProcessQueryValue(filterArg FilterFunc, processArg ProcessFunc)
- func (e *ESql) SetBucketNum(bucketNumArg int)
- func (e *ESql) SetPageSize(pageSizeArg int)
- func (e *ESql) SetTemporal(temporalArg bool)
- type FilterFunc
- type ProcessFunc
Constants ¶
const ( DefaultPageSize = 1000 DefaultBucketNumber = 1000 ESDefaultMaxPageSize = 10000 TieBreaker = "RunId" RunID = "RunId" StartTime = "StartTime" NamespaceID = "NamespaceId" WorkflowID = "WorkflowId" ExecutionTime = "ExecutionTime" TieBreakerOrder = "desc" StartTimeOrder = "desc" )
default sizes and identifiers used in temporal visibility
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ESql ¶
type ESql struct {
// contains filtered or unexported fields
}
ESql ... ESql is used to hold necessary information that required in parsing
func (*ESql) Convert ¶
func (e *ESql) Convert(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
Convert ... Transform sql to elasticsearch dsl string
usage:
- dsl, sortField, err := e.Convert(sql, pageParam1, pageParam2, ...)
arguments:
- sql: the sql query needs conversion in string format
- pagination: variadic arguments that indicates es search_after
return values:
- dsl: the elasticsearch dsl json style string
- sortField: string array that contains all column names used for sorting. useful for pagination.
- err: contains err information
func (*ESql) ConvertPretty ¶
func (e *ESql) ConvertPretty(sql string, pagination ...interface{}) (dsl string, sortField []string, err error)
ConvertPretty ... Transform sql to elasticsearch dsl, and prettify the output json
usage:
- dsl, sortField, err := e.ConvertPretty(sql, pageParam1, pageParam2, ...)
arguments:
- sql: the sql query needs conversion in string format
- pagination: variadic arguments that indicates es search_after for pagination
return values:
- dsl: the elasticsearch dsl json style string
- sortField: string array that contains all column names used for sorting. useful for pagination.
- err: contains err information
func (*ESql) ConvertPrettyTemporal ¶ added in v0.27.0
func (e *ESql) ConvertPrettyTemporal(sql string, namespaceID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
ConvertPrettyTemporal ... convert sql to es dsl, for temporal usage
func (*ESql) ConvertTemporal ¶ added in v0.27.0
func (e *ESql) ConvertTemporal(sql string, namespaceID string, pagination ...interface{}) (dsl string, sortFields []string, err error)
ConvertTemporal ... convert sql to es dsl, for temporal usage
func (*ESql) ProcessQueryKey ¶
func (e *ESql) ProcessQueryKey(filterArg FilterFunc, processArg ProcessFunc)
ProcessQueryKey ... set up user specified column name processing policy should not be called if there is potential race condition
func (*ESql) ProcessQueryValue ¶
func (e *ESql) ProcessQueryValue(filterArg FilterFunc, processArg ProcessFunc)
ProcessQueryValue ... set up user specified column value processing policy should not be called if there is potential race condition
func (*ESql) SetBucketNum ¶
SetBucketNum ... set the number of bucket returned in an aggregation query should not be called if there is potential race condition
func (*ESql) SetPageSize ¶
SetPageSize ... set the number of documents returned in a non-aggregation query should not be called if there is potential race condition
func (*ESql) SetTemporal ¶ added in v0.27.0
SetTemporal ... specify whether do special handling for temporal visibility should not be called if there is potential race condition should not be called by non-temporal user
type FilterFunc ¶
FilterFunc ... esql use FilterFunc to determine whether a target is to be processed by ProcessFunc only those FilterFunc(colName) == true will be processed
type ProcessFunc ¶
ProcessFunc ... esql use ProcessFunc to process query key value macro