MCPcopy Index your code
hub / github.com/bytebase/bytebase / convertPathAST

Function convertPathAST

backend/plugin/parser/elasticsearch/query_span.go:52–66  ·  view source on GitHub ↗

convertPathAST converts an omni PathAST to a bytebase base.PathAST.

(p *es.PathAST)

Source from the content-addressed store, hash-verified

50
51// convertPathAST converts an omni PathAST to a bytebase base.PathAST.
52func convertPathAST(p *es.PathAST) *base.PathAST {
53 if p == nil || p.Root == nil {
54 return nil
55 }
56 root := base.NewItemSelector(p.Root.Name)
57 current := base.SelectorNode(root)
58 omniCurrent := p.Root.Next
59 for omniCurrent != nil {
60 next := base.NewItemSelector(omniCurrent.Name)
61 current.SetNext(next)
62 current = next
63 omniCurrent = omniCurrent.Next
64 }
65 return base.NewPathAST(root)
66}
67
68// convertAnalysis converts an omni analysis.RequestAnalysis to a bytebase base.ElasticsearchAnalysis.
69func convertAnalysis(a *analysis.RequestAnalysis) *base.ElasticsearchAnalysis {

Callers 1

GetQuerySpanFunction · 0.85

Calls 4

NewItemSelectorFunction · 0.92
SelectorNodeInterface · 0.92
NewPathASTFunction · 0.92
SetNextMethod · 0.65

Tested by

no test coverage detected