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

Method VisitSampledRelation

query/sql/sql_parser.go:818–835  ·  view source on GitHub ↗

VisitSampledRelation visits the node

(ctx *antlrgen.SampledRelationContext)

Source from the content-addressed store, hash-verified

816
817// VisitSampledRelation visits the node
818func (v *ASTBuilder) VisitSampledRelation(ctx *antlrgen.SampledRelationContext) interface{} {
819 v.Logger.Debugf("VisitSampledRelation: %s", ctx.GetText())
820
821 location := v.getLocation(ctx)
822 level, levelWith, levelQuery := v.getCtxLevels(v.SQL2AqlCtx)
823
824 v.setCtxLevels(v.SQL2AqlCtx, level, levelWith, levelQuery)
825 child, _ := v.VisitAliasedRelation(ctx.AliasedRelation().(*antlrgen.AliasedRelationContext)).(tree.IRelation)
826 if ctx.TABLESAMPLE() != nil {
827 panic(fmt.Errorf("TABLESAMPLE not implemented at (line:%d, col:%d)", location.Line, location.CharPosition))
828 }
829 if child != nil {
830 child.SetValue(fmt.Sprintf("SampledRelation: (%s)", v.getText(ctx.BaseParserRuleContext)))
831 }
832
833 v.setCtxLevels(v.SQL2AqlCtx, level-1, levelWith, levelQuery)
834 return child
835}
836
837// VisitAliasedRelation visits the node
838func (v *ASTBuilder) VisitAliasedRelation(ctx *antlrgen.AliasedRelationContext) interface{} {

Callers 1

VisitJoinRelationMethod · 0.95

Calls 10

getLocationMethod · 0.95
getCtxLevelsMethod · 0.95
setCtxLevelsMethod · 0.95
VisitAliasedRelationMethod · 0.95
getTextMethod · 0.95
DebugfMethod · 0.65
ErrorfMethod · 0.65
SetValueMethod · 0.65
AliasedRelationMethod · 0.45
TABLESAMPLEMethod · 0.45

Tested by

no test coverage detected