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

Method Compile

query/aql_compiler.go:44–103  ·  view source on GitHub ↗

Compile compiles AQLQueryContext for data feeding and query execution. Caller should check for AQLQueryContext.Error.

(tableSchemaReader memCom.TableSchemaReader, shardOwner topology.ShardOwner)

Source from the content-addressed store, hash-verified

42// Compile compiles AQLQueryContext for data feeding and query
43// execution. Caller should check for AQLQueryContext.Error.
44func (qc *AQLQueryContext) Compile(tableSchemaReader memCom.TableSchemaReader, shardOwner topology.ShardOwner) {
45 // processTimezone might append additional joins
46 qc.processTimezone()
47 if qc.Error != nil {
48 return
49 }
50
51 // Read schema for every table used.
52 qc.readSchema(tableSchemaReader, shardOwner)
53 defer qc.releaseSchema()
54 if qc.Error != nil {
55 return
56 }
57
58 // Parse all other SQL expressions to ASTs.
59 qc.parseExprs()
60 if qc.Error != nil {
61 return
62 }
63
64 // Resolve data types in the ASTs against schema, also translate enum values.
65 qc.resolveTypes()
66 if qc.Error != nil {
67 return
68 }
69
70 // Process join conditions first to collect information about geo join.
71 qc.processJoinConditions()
72 if qc.Error != nil {
73 return
74 }
75
76 // Identify prefilters.
77 qc.matchPrefilters()
78
79 // Process filters.
80 qc.processFilters()
81 if qc.Error != nil {
82 return
83 }
84
85 // Process measure and dimensions.
86 qc.processMeasure()
87 if qc.Error != nil {
88 return
89 }
90 qc.processDimensions()
91 if qc.Error != nil {
92 return
93 }
94
95 qc.sortUsedColumns()
96
97 qc.sortDimensionColumns()
98 if qc.Error != nil {
99 return
100 }
101

Callers 3

handleAQLInternalMethod · 0.95
handleQueryFunction · 0.45

Calls 12

processTimezoneMethod · 0.95
readSchemaMethod · 0.95
releaseSchemaMethod · 0.95
parseExprsMethod · 0.95
resolveTypesMethod · 0.95
processJoinConditionsMethod · 0.95
matchPrefiltersMethod · 0.95
processFiltersMethod · 0.95
processMeasureMethod · 0.95
processDimensionsMethod · 0.95
sortUsedColumnsMethod · 0.95
sortDimensionColumnsMethod · 0.95

Tested by

no test coverage detected