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

Method processJoinConditions

query/aql_compiler.go:169–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167}
168
169func (qc *AQLQueryContext) processJoinConditions() {
170 if len(qc.Query.Joins) > 8 {
171 qc.Error = utils.StackError(nil, "At most %d foreign tables allowed, got: %d", 8, len(qc.Query.Joins))
172 return
173 }
174
175 qc.OOPK.foreignTables = make([]*foreignTable, len(qc.Query.Joins))
176 mainTableSchema := qc.TableSchemaByName[qc.Query.Table]
177 for joinTableID, join := range qc.Query.Joins {
178 joinSchema := qc.TableSchemaByName[join.Table]
179 if isGeoJoin(join) {
180 if qc.OOPK.geoIntersection != nil {
181 qc.Error = utils.StackError(nil, "At most one geo join allowed")
182 return
183 }
184 qc.matchGeoJoin(joinTableID, mainTableSchema, joinSchema, join.ConditionsParsed)
185 if qc.Error != nil {
186 return
187 }
188 } else {
189 // we will extract the geo join out of the join conditions since we are going to handle geo intersects
190 // as filter instead of an equal join.
191 qc.OOPK.foreignTables[joinTableID] = &foreignTable{}
192 qc.matchEqualJoin(joinTableID, joinSchema, join.ConditionsParsed)
193 if qc.Error != nil {
194 return
195 }
196 }
197 }
198}
199
200// matchGeoJoin initializes the GeoIntersection struct for later query process use. For now only one geo join is
201// allowed per query. If users want to intersect with multiple geo join conditions, they should specify multiple geo

Callers 2

CompileMethod · 0.95

Calls 4

matchGeoJoinMethod · 0.95
matchEqualJoinMethod · 0.95
StackErrorFunction · 0.92
isGeoJoinFunction · 0.85

Tested by

no test coverage detected