MCPcopy Index your code
hub / github.com/uber/aresdb / VisitTableName

Method VisitTableName

query/sql/sql_parser.go:907–924  ·  view source on GitHub ↗

VisitTableName visits the node

(ctx *antlrgen.TableNameContext)

Source from the content-addressed store, hash-verified

905
906// VisitTableName visits the node
907func (v *ASTBuilder) VisitTableName(ctx *antlrgen.TableNameContext) interface{} {
908 v.Logger.Debugf("VisitTableName: %s", ctx.GetText())
909
910 last := len(v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey]) - 1
911 // check if the table name is a withQ identifier
912 name := v.getText(ctx.BaseParserRuleContext)
913 qLevel, _, _ := v.getInfoByKey(v.SQL2AqlCtx.mapKey)
914 if qLevel == 0 && v.isWithQueryIdentifier(v.SQL2AqlCtx, name) {
915 v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey][last].Alias = name
916 } else {
917 v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey][last].Table = name
918 }
919
920 table := tree.NewTable(v.getLocation(ctx), v.getQualifiedName(ctx.QualifiedName()))
921 table.SetValue(fmt.Sprintf("Table: (%s)", v.getText(ctx.BaseParserRuleContext)))
922
923 return table
924}
925
926// VisitSubqueryRelation visits the node
927func (v *ASTBuilder) VisitSubqueryRelation(ctx *antlrgen.SubqueryRelationContext) interface{} {

Callers

nothing calls this directly

Calls 9

getTextMethod · 0.95
getInfoByKeyMethod · 0.95
isWithQueryIdentifierMethod · 0.95
getLocationMethod · 0.95
getQualifiedNameMethod · 0.95
NewTableFunction · 0.92
DebugfMethod · 0.65
SetValueMethod · 0.65
QualifiedNameMethod · 0.45

Tested by

no test coverage detected