MCPcopy
hub / github.com/uber/aresdb / addQIdentifier

Method addQIdentifier

query/sql/sql_parser.go:1896–1906  ·  view source on GitHub ↗

addQIdentifier adds subquery/withQuery identifier and its mapKey into queryIdentifierSet

(s2aCtx *SQL2AqlContext, indentifier string, key int)

Source from the content-addressed store, hash-verified

1894
1895// addQIdentifier adds subquery/withQuery identifier and its mapKey into queryIdentifierSet
1896func (v *ASTBuilder) addQIdentifier(s2aCtx *SQL2AqlContext, indentifier string, key int) error {
1897 if s2aCtx.queryIdentifierSet == nil {
1898 s2aCtx.queryIdentifierSet = make(map[string]int)
1899 }
1900 if _, exist := s2aCtx.queryIdentifierSet[indentifier]; exist {
1901 return fmt.Errorf("subquery/withQuery identifier: %v already exist", indentifier)
1902 }
1903 s2aCtx.queryIdentifierSet[indentifier] = key
1904
1905 return nil
1906}
1907
1908// isWithQueryIdentifier check if name is a withQuery identifier
1909func (v *ASTBuilder) isWithQueryIdentifier(s2aCtx *SQL2AqlContext, name string) bool {

Callers 2

VisitNamedQueryMethod · 0.95
VisitSubqueryRelationMethod · 0.95

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected