本文整理汇总了Golang中github.com/pingcap/tidb/util/distinct.CreateDistinctChecker函数的典型用法代码示例。如果您正苦于以下问题:Golang CreateDistinctChecker函数的具体用法?Golang CreateDistinctChecker怎么用?Golang CreateDistinctChecker使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CreateDistinctChecker函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: getStreamedContext
func (af *aggFunction) getStreamedContext() *ast.AggEvaluateContext {
if af.streamCtx == nil {
af.streamCtx = &ast.AggEvaluateContext{}
if af.Distinct {
af.streamCtx.DistinctChecker = distinct.CreateDistinctChecker()
}
}
return af.streamCtx
}
示例2: getContext
func (af *aggFunction) getContext(groupKey []byte) *ast.AggEvaluateContext {
ctx, ok := af.resultMapper[string(groupKey)]
if !ok {
ctx = &ast.AggEvaluateContext{}
if af.Distinct {
ctx.DistinctChecker = distinct.CreateDistinctChecker()
}
af.resultMapper[string(groupKey)] = ctx
}
return ctx
}
示例3: GetContext
// GetContext gets aggregate evaluation context for the current group.
// If it is nil, add a new context into contextPerGroupMap.
func (n *AggregateFuncExpr) GetContext() *AggEvaluateContext {
if n.contextPerGroupMap == nil {
n.contextPerGroupMap = make(map[string](*AggEvaluateContext))
}
if _, ok := n.contextPerGroupMap[n.CurrentGroup]; !ok {
c := &AggEvaluateContext{}
if n.Distinct {
c.distinctChecker = distinct.CreateDistinctChecker()
}
n.contextPerGroupMap[n.CurrentGroup] = c
}
return n.contextPerGroupMap[n.CurrentGroup]
}
示例4: Next
// Next implements Executor Next interface.
func (e *DistinctExec) Next() (*Row, error) {
if e.checker == nil {
e.checker = distinct.CreateDistinctChecker()
}
for {
row, err := e.Src.Next()
if err != nil {
return nil, errors.Trace(err)
}
if row == nil {
return nil, nil
}
ok, err := e.checker.Check(types.DatumsToInterfaces(row.Data))
if err != nil {
return nil, errors.Trace(err)
}
if !ok {
continue
}
return row, nil
}
}