Compile compiles AQLQueryContext for data feeding and query execution. Caller should check for AQLQueryContext.Error.
(tableSchemaReader memCom.TableSchemaReader, shardOwner topology.ShardOwner)
| 42 | // Compile compiles AQLQueryContext for data feeding and query |
| 43 | // execution. Caller should check for AQLQueryContext.Error. |
| 44 | func (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 |
no test coverage detected