@malloydata/malloy 0.0.101-dev231107220340 → 0.0.101-dev231109201517

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Annotation, DocumentLocation, PipeSegment, Pipeline, StructDef } from '../../../model/malloy_types';
2
- import { FieldName, FieldSpace } from '../types/field-space';
2
+ import { FieldSpace } from '../types/field-space';
3
3
  import { MalloyElement } from '../types/malloy-element';
4
4
  import { QOPDesc } from '../query-properties/qop-desc';
5
5
  import { QueryInputSpace } from '../field-space/query-input-space';
@@ -23,7 +23,7 @@ export declare abstract class PipelineDesc extends MalloyElement {
23
23
  addSegments(...segDesc: QOPDesc[]): void;
24
24
  protected appendOps(pipelineOutput: FieldSpace, modelPipe: PipeSegment[]): AppendResult;
25
25
  protected refinePipeline(fs: FieldSpace, modelPipe: Pipeline): Pipeline;
26
- protected expandTurtle(turtleName: string, fromStruct: StructDef): {
26
+ protected expandTurtle(turtleName: ViewFieldReference, fromStruct: StructDef): {
27
27
  needsExpansionDueToScalar: boolean;
28
28
  pipeline: PipeSegment[];
29
29
  location: DocumentLocation | undefined;
@@ -31,8 +31,8 @@ export declare abstract class PipelineDesc extends MalloyElement {
31
31
  };
32
32
  }
33
33
  export declare abstract class TurtleHeadedPipe extends PipelineDesc {
34
- _turtleName?: FieldName;
35
- set turtleName(turtleName: FieldName | undefined);
36
- get turtleName(): FieldName | undefined;
34
+ _turtleName?: ViewFieldReference;
35
+ set turtleName(turtleName: ViewFieldReference | undefined);
36
+ get turtleName(): ViewFieldReference | undefined;
37
37
  }
38
38
  export {};
@@ -23,9 +23,13 @@
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.TurtleHeadedPipe = exports.PipelineDesc = void 0;
26
+ const malloy_types_1 = require("../../../model/malloy_types");
27
+ const field_space_1 = require("../types/field-space");
26
28
  const malloy_element_1 = require("../types/malloy-element");
27
- const struct_utils_1 = require("../struct-utils");
29
+ const field_references_1 = require("../query-items/field-references");
28
30
  const refinements_1 = require("../query-properties/refinements");
31
+ const static_space_1 = require("../field-space/static-space");
32
+ const space_field_1 = require("../types/space-field");
29
33
  /**
30
34
  * Generic abstract for all pipelines, the first segment might be a reference
31
35
  * to an existing pipeline (query or turtle), and if there is a refinement it
@@ -68,7 +72,11 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
68
72
  }
69
73
  let pipeline = [];
70
74
  if (modelPipe.pipeHead) {
71
- const { pipeline: turtlePipe } = this.expandTurtle(modelPipe.pipeHead.name, fs.structDef());
75
+ const ref = new field_references_1.ViewFieldReference([
76
+ new field_space_1.FieldName(modelPipe.pipeHead.name),
77
+ ]);
78
+ this.has({ ref });
79
+ const { pipeline: turtlePipe } = this.expandTurtle(ref, fs.structDef());
72
80
  pipeline.push(...turtlePipe);
73
81
  }
74
82
  pipeline.push(...modelPipe.pipeline);
@@ -79,34 +87,54 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
79
87
  return { pipeline };
80
88
  }
81
89
  expandTurtle(turtleName, fromStruct) {
82
- const turtle = (0, struct_utils_1.getStructFieldDef)(fromStruct, turtleName);
90
+ var _a;
91
+ const fs = new static_space_1.StaticSpace(fromStruct);
92
+ const lookup = turtleName.getField(fs);
83
93
  let annotation;
84
- if (!turtle) {
94
+ if (!lookup.found) {
85
95
  this.log(`Query '${turtleName}' is not defined in source`);
86
96
  }
87
- else if (turtle.type !== 'turtle') {
88
- if (this.inExperiment('scalar_lenses', true)) {
97
+ else if (lookup.found instanceof space_field_1.SpaceField) {
98
+ const fieldDef = lookup.found.fieldDef();
99
+ if (fieldDef && (0, malloy_types_1.isAtomicField)(fieldDef)) {
100
+ if (this.inExperiment('scalar_lenses', true)) {
101
+ return {
102
+ needsExpansionDueToScalar: true,
103
+ pipeline: [
104
+ {
105
+ type: 'reduce',
106
+ fields: [
107
+ {
108
+ type: fieldDef.type,
109
+ name: (_a = fieldDef.as) !== null && _a !== void 0 ? _a : fieldDef.name,
110
+ expressionType: fieldDef.expressionType,
111
+ e: [{ type: 'field', path: turtleName.refString }],
112
+ },
113
+ ],
114
+ },
115
+ ],
116
+ location: fieldDef.location,
117
+ annotation,
118
+ };
119
+ }
120
+ else {
121
+ this.log(`'${turtleName.refString}' is not a query`);
122
+ }
123
+ }
124
+ else if (turtleName.list.length > 1) {
125
+ this.log('Cannot use view from join');
126
+ }
127
+ else if (fieldDef && (0, malloy_types_1.isTurtleDef)(fieldDef)) {
128
+ if (fieldDef.annotation) {
129
+ annotation = { inherits: fieldDef.annotation };
130
+ }
89
131
  return {
90
- needsExpansionDueToScalar: true,
91
- pipeline: [{ type: 'reduce', fields: [turtle.name] }],
92
- location: turtle.location,
132
+ pipeline: fieldDef.pipeline,
133
+ location: fieldDef.location,
93
134
  annotation,
135
+ needsExpansionDueToScalar: false,
94
136
  };
95
137
  }
96
- else {
97
- this.log(`'${turtleName}' is not a query`);
98
- }
99
- }
100
- else {
101
- if (turtle.annotation) {
102
- annotation = { inherits: turtle.annotation };
103
- }
104
- return {
105
- pipeline: turtle.pipeline,
106
- location: turtle.location,
107
- annotation,
108
- needsExpansionDueToScalar: false,
109
- };
110
138
  }
111
139
  return {
112
140
  pipeline: [],
@@ -221,7 +221,7 @@ class SQAppendView extends source_query_1.SourceQueryNode {
221
221
  const head = views[0];
222
222
  const refinements = views.slice(1);
223
223
  if (head instanceof field_references_1.ViewFieldReference) {
224
- theQuery.turtleName = head.list[0];
224
+ theQuery.turtleName = head;
225
225
  }
226
226
  else if (head instanceof qop_desc_1.QOPDesc) {
227
227
  theQuery.addSegments(head);
@@ -74,8 +74,7 @@ class FullQuery extends pipeline_desc_1.TurtleHeadedPipe {
74
74
  const lookFor = this.turtleName.getField(pipeFS);
75
75
  if (lookFor.error)
76
76
  this.log(lookFor.error);
77
- const name = this.turtleName.refString;
78
- const { pipeline, location, annotation, needsExpansionDueToScalar } = this.expandTurtle(name, structDef);
77
+ const { pipeline, location, annotation, needsExpansionDueToScalar } = this.expandTurtle(this.turtleName, structDef);
79
78
  destQuery.location = location;
80
79
  let walkPipe = pipeline;
81
80
  if (this.refinements &&
@@ -95,7 +94,7 @@ class FullQuery extends pipeline_desc_1.TurtleHeadedPipe {
95
94
  destQuery.pipeline = pipeline;
96
95
  }
97
96
  else {
98
- destQuery.pipeHead = { name };
97
+ destQuery.pipeHead = { name: this.turtleName.refString };
99
98
  }
100
99
  if (annotation) {
101
100
  destQuery.annotation = annotation;
@@ -1,5 +1,5 @@
1
1
  import * as model from '../../../model/malloy_types';
2
- import { FieldName, FieldSpace } from '../types/field-space';
2
+ import { FieldSpace } from '../types/field-space';
3
3
  import { MalloyElement } from '../types/malloy-element';
4
4
  import { Noteable, extendNoteMethod } from '../types/noteable';
5
5
  import { QueryField } from '../field-space/query-space-field';
@@ -10,7 +10,7 @@ import { QueryBuilder } from '../types/query-builder';
10
10
  import { MakeEntry } from '../types/space-entry';
11
11
  import { DynamicSpace } from '../field-space/dynamic-space';
12
12
  import { TypeDesc } from '../../../model';
13
- import { FieldReference } from '../query-items/field-references';
13
+ import { FieldReference, ViewFieldReference } from '../query-items/field-references';
14
14
  declare abstract class TurtleDeclRoot extends TurtleHeadedPipe implements Noteable, MakeEntry {
15
15
  readonly name: string;
16
16
  readonly isNoteableObj = true;
@@ -28,7 +28,7 @@ export declare class NestRefinement extends TurtleDeclRoot implements QueryPrope
28
28
  elementType: string;
29
29
  queryRefinementStage: LegalRefinementStage;
30
30
  forceQueryClass: QueryClass;
31
- constructor(turtleName: FieldName);
31
+ constructor(turtleName: ViewFieldReference);
32
32
  queryExecute(executeFor: QueryBuilder): void;
33
33
  makeEntry(fs: DynamicSpace): void;
34
34
  }
@@ -51,12 +51,13 @@ export declare class QueryFieldAST extends QueryField {
51
51
  fieldDef(): model.TurtleDef;
52
52
  }
53
53
  export declare class NestReference extends FieldReference implements QueryPropertyInterface, MakeEntry {
54
- readonly name: FieldName;
54
+ readonly name: FieldReference;
55
55
  elementType: string;
56
56
  forceQueryClass: QueryClass;
57
57
  queryRefinementStage: LegalRefinementStage;
58
- constructor(name: FieldName);
58
+ constructor(name: FieldReference);
59
59
  typecheck(type: TypeDesc): void;
60
+ makeEntry(fs: DynamicSpace): void;
60
61
  queryExecute(executeFor: QueryBuilder): void;
61
62
  }
62
63
  export type NestedQuery = NestReference | NestDefinition | NestRefinement;
@@ -21,8 +21,32 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
+ desc = { enumerable: true, get: function() { return m[k]; } };
29
+ }
30
+ Object.defineProperty(o, k2, desc);
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
24
47
  Object.defineProperty(exports, "__esModule", { value: true });
25
48
  exports.NestReference = exports.QueryFieldAST = exports.isNestedQuery = exports.NestDefinition = exports.NestRefinement = exports.TurtleDecl = void 0;
49
+ const model = __importStar(require("../../../model/malloy_types"));
26
50
  const noteable_1 = require("../types/noteable");
27
51
  const query_space_field_1 = require("../field-space/query-space-field");
28
52
  const pipeline_desc_1 = require("../elements/pipeline-desc");
@@ -34,6 +58,8 @@ const field_references_1 = require("../query-items/field-references");
34
58
  const struct_utils_1 = require("../struct-utils");
35
59
  const column_space_field_1 = require("../field-space/column-space-field");
36
60
  const query_utils_1 = require("../query-utils");
61
+ const space_field_1 = require("../types/space-field");
62
+ const query_field_struct_1 = require("../field-space/query-field-struct");
37
63
  function isTurtle(fd) {
38
64
  const ret = fd && typeof fd !== 'string' && fd.type === 'turtle';
39
65
  return !!ret;
@@ -55,6 +81,9 @@ class TurtleDeclRoot extends pipeline_desc_1.TurtleHeadedPipe {
55
81
  reportWrongType = false;
56
82
  }
57
83
  else if (headEnt.found instanceof query_space_field_1.QueryField) {
84
+ if (this.turtleName.list.length > 1) {
85
+ this.turtleName.log('Cannot use view from join');
86
+ }
58
87
  const headDef = headEnt.found.getQueryFieldDef(fs);
59
88
  if (isTurtle(headDef)) {
60
89
  const newPipe = this.refinePipeline(fs, headDef);
@@ -131,7 +160,7 @@ class TurtleDecl extends TurtleDeclRoot {
131
160
  exports.TurtleDecl = TurtleDecl;
132
161
  class NestRefinement extends TurtleDeclRoot {
133
162
  constructor(turtleName) {
134
- super(turtleName.refString);
163
+ super(turtleName.outputName);
135
164
  this.elementType = 'nestRefinement';
136
165
  this.queryRefinementStage = query_property_interface_1.LegalRefinementStage.Single;
137
166
  this.forceQueryClass = query_property_interface_1.QueryClass.Grouping;
@@ -202,7 +231,7 @@ class QueryFieldAST extends query_space_field_1.QueryField {
202
231
  exports.QueryFieldAST = QueryFieldAST;
203
232
  class NestReference extends field_references_1.FieldReference {
204
233
  constructor(name) {
205
- super([name]);
234
+ super([...name.list]);
206
235
  this.name = name;
207
236
  this.elementType = 'nestReference';
208
237
  this.forceQueryClass = query_property_interface_1.QueryClass.Grouping;
@@ -216,19 +245,60 @@ class NestReference extends field_references_1.FieldReference {
216
245
  useInstead = 'a calculate';
217
246
  kind = 'an analytic';
218
247
  }
219
- else if ((0, model_1.expressionIsScalar)(type.expressionType)) {
220
- useInstead = 'a group_by or select';
221
- kind = 'a scalar';
248
+ else {
249
+ if (this.inExperiment('scalar_lenses', true)) {
250
+ return;
251
+ }
252
+ if ((0, model_1.expressionIsScalar)(type.expressionType)) {
253
+ useInstead = 'a group_by or select';
254
+ kind = 'a scalar';
255
+ }
256
+ else if ((0, model_1.expressionIsAggregate)(type.expressionType)) {
257
+ useInstead = 'an aggregate';
258
+ kind = 'an aggregate';
259
+ }
260
+ else {
261
+ throw new Error(`Unexpected expression type ${type} not handled here`);
262
+ }
263
+ this.log(`Cannot use ${kind} field in a nest operation, did you mean to use ${useInstead} operation instead?`);
222
264
  }
223
- else if ((0, model_1.expressionIsAggregate)(type.expressionType)) {
224
- useInstead = 'an aggregate';
225
- kind = 'an aggregate';
265
+ }
266
+ }
267
+ makeEntry(fs) {
268
+ var _a;
269
+ if (fs instanceof query_spaces_1.QuerySpace) {
270
+ const lookup = this.name.getField(fs.inputSpace());
271
+ if (lookup.found instanceof space_field_1.SpaceField) {
272
+ const field = lookup.found.fieldDef();
273
+ if (field && model.isAtomicField(field)) {
274
+ const name = (_a = field.as) !== null && _a !== void 0 ? _a : field.name;
275
+ fs.newEntry(name, this, new query_field_struct_1.QueryFieldStruct(fs, {
276
+ type: 'turtle',
277
+ name,
278
+ pipeline: [
279
+ {
280
+ type: 'reduce',
281
+ fields: [
282
+ {
283
+ type: field.type,
284
+ name,
285
+ expressionType: field.expressionType,
286
+ e: [{ type: 'field', path: this.name.refString }],
287
+ },
288
+ ],
289
+ },
290
+ ],
291
+ }));
292
+ return;
293
+ }
226
294
  }
227
- else {
228
- throw new Error(`Unexpected expression type ${type} not handled here`);
295
+ if (this.name.list.length > 1) {
296
+ this.log('Cannot nest view from join');
297
+ return;
229
298
  }
230
- this.log(`Cannot use ${kind} field in a nest operation, did you mean to use ${useInstead} operation instead?`);
299
+ return super.makeEntry(fs);
231
300
  }
301
+ throw this.internalError('Unexpected namespace for nest');
232
302
  }
233
303
  queryExecute(executeFor) {
234
304
  executeFor.resultFS.pushFields(this);
@@ -56,6 +56,10 @@ class NamedRefinement extends Refinement {
56
56
  this.name.log(`named refinement \`${this.name.refString}\` must have exactly one stage`);
57
57
  return;
58
58
  }
59
+ if (this.name.list.length > 1) {
60
+ this.log('Cannot use view from join as refinement');
61
+ return;
62
+ }
59
63
  return fieldDef.pipeline[0];
60
64
  }
61
65
  if ((fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) !== 'struct') {
@@ -194,103 +194,102 @@ export declare class MalloyParser extends Parser {
194
194
  static readonly RULE_connectionId = 31;
195
195
  static readonly RULE_queryProperties = 32;
196
196
  static readonly RULE_filterShortcut = 33;
197
- static readonly RULE_exploreQueryName = 34;
198
- static readonly RULE_queryName = 35;
199
- static readonly RULE_sourcePropertyList = 36;
200
- static readonly RULE_sourceDefinition = 37;
201
- static readonly RULE_sqExplore = 38;
202
- static readonly RULE_sourceNameDef = 39;
203
- static readonly RULE_sourceID = 40;
204
- static readonly RULE_exploreProperties = 41;
205
- static readonly RULE_exploreStatement = 42;
206
- static readonly RULE_defMeasures = 43;
207
- static readonly RULE_defDimensions = 44;
208
- static readonly RULE_renameList = 45;
209
- static readonly RULE_exploreRenameDef = 46;
210
- static readonly RULE_defList = 47;
211
- static readonly RULE_fieldDef = 48;
212
- static readonly RULE_fieldNameDef = 49;
213
- static readonly RULE_joinNameDef = 50;
214
- static readonly RULE_declareStatement = 51;
215
- static readonly RULE_joinStatement = 52;
216
- static readonly RULE_queryExtend = 53;
217
- static readonly RULE_ambiguousModification = 54;
218
- static readonly RULE_modEither = 55;
219
- static readonly RULE_sqExpr = 56;
220
- static readonly RULE_leadSeg = 57;
221
- static readonly RULE_qSeg = 58;
222
- static readonly RULE_queryExtendStatement = 59;
223
- static readonly RULE_queryExtendStatementList = 60;
224
- static readonly RULE_joinList = 61;
225
- static readonly RULE_isExplore = 62;
226
- static readonly RULE_joinDef = 63;
227
- static readonly RULE_joinExpression = 64;
228
- static readonly RULE_filterStatement = 65;
229
- static readonly RULE_filteredBy = 66;
230
- static readonly RULE_filterClauseList = 67;
231
- static readonly RULE_whereStatement = 68;
232
- static readonly RULE_havingStatement = 69;
233
- static readonly RULE_subQueryDefList = 70;
234
- static readonly RULE_exploreQueryNameDef = 71;
235
- static readonly RULE_exploreQueryDef = 72;
236
- static readonly RULE_queryStatement = 73;
237
- static readonly RULE_queryJoinStatement = 74;
238
- static readonly RULE_groupByStatement = 75;
239
- static readonly RULE_queryFieldList = 76;
240
- static readonly RULE_queryFieldEntry = 77;
241
- static readonly RULE_nestStatement = 78;
242
- static readonly RULE_nestedQueryList = 79;
243
- static readonly RULE_nestEntry = 80;
244
- static readonly RULE_aggregateStatement = 81;
245
- static readonly RULE_calculateStatement = 82;
246
- static readonly RULE_projectStatement = 83;
247
- static readonly RULE_orderByStatement = 84;
248
- static readonly RULE_ordering = 85;
249
- static readonly RULE_orderBySpec = 86;
250
- static readonly RULE_limitStatement = 87;
251
- static readonly RULE_bySpec = 88;
252
- static readonly RULE_topStatement = 89;
253
- static readonly RULE_indexElement = 90;
254
- static readonly RULE_indexFields = 91;
255
- static readonly RULE_indexStatement = 92;
256
- static readonly RULE_sampleStatement = 93;
257
- static readonly RULE_timezoneStatement = 94;
258
- static readonly RULE_queryAnnotation = 95;
259
- static readonly RULE_sampleSpec = 96;
260
- static readonly RULE_aggregate = 97;
261
- static readonly RULE_malloyType = 98;
262
- static readonly RULE_compareOp = 99;
263
- static readonly RULE_string = 100;
264
- static readonly RULE_shortString = 101;
265
- static readonly RULE_numericLiteral = 102;
266
- static readonly RULE_literal = 103;
267
- static readonly RULE_dateLiteral = 104;
268
- static readonly RULE_tablePath = 105;
269
- static readonly RULE_tableURI = 106;
270
- static readonly RULE_id = 107;
271
- static readonly RULE_timeframe = 108;
272
- static readonly RULE_ungroup = 109;
273
- static readonly RULE_malloyOrSQLType = 110;
274
- static readonly RULE_fieldExpr = 111;
275
- static readonly RULE_partialAllowedFieldExpr = 112;
276
- static readonly RULE_pickStatement = 113;
277
- static readonly RULE_pick = 114;
278
- static readonly RULE_argumentList = 115;
279
- static readonly RULE_fieldNameList = 116;
280
- static readonly RULE_fieldCollection = 117;
281
- static readonly RULE_collectionWildCard = 118;
282
- static readonly RULE_starQualified = 119;
283
- static readonly RULE_taggedRef = 120;
284
- static readonly RULE_refExpr = 121;
285
- static readonly RULE_collectionMember = 122;
286
- static readonly RULE_fieldPath = 123;
287
- static readonly RULE_joinName = 124;
288
- static readonly RULE_fieldName = 125;
289
- static readonly RULE_justExpr = 126;
290
- static readonly RULE_sqlExploreNameRef = 127;
291
- static readonly RULE_nameSQLBlock = 128;
292
- static readonly RULE_connectionName = 129;
293
- static readonly RULE_experimentalStatementForTesting = 130;
197
+ static readonly RULE_queryName = 34;
198
+ static readonly RULE_sourcePropertyList = 35;
199
+ static readonly RULE_sourceDefinition = 36;
200
+ static readonly RULE_sqExplore = 37;
201
+ static readonly RULE_sourceNameDef = 38;
202
+ static readonly RULE_sourceID = 39;
203
+ static readonly RULE_exploreProperties = 40;
204
+ static readonly RULE_exploreStatement = 41;
205
+ static readonly RULE_defMeasures = 42;
206
+ static readonly RULE_defDimensions = 43;
207
+ static readonly RULE_renameList = 44;
208
+ static readonly RULE_exploreRenameDef = 45;
209
+ static readonly RULE_defList = 46;
210
+ static readonly RULE_fieldDef = 47;
211
+ static readonly RULE_fieldNameDef = 48;
212
+ static readonly RULE_joinNameDef = 49;
213
+ static readonly RULE_declareStatement = 50;
214
+ static readonly RULE_joinStatement = 51;
215
+ static readonly RULE_queryExtend = 52;
216
+ static readonly RULE_ambiguousModification = 53;
217
+ static readonly RULE_modEither = 54;
218
+ static readonly RULE_sqExpr = 55;
219
+ static readonly RULE_leadSeg = 56;
220
+ static readonly RULE_qSeg = 57;
221
+ static readonly RULE_queryExtendStatement = 58;
222
+ static readonly RULE_queryExtendStatementList = 59;
223
+ static readonly RULE_joinList = 60;
224
+ static readonly RULE_isExplore = 61;
225
+ static readonly RULE_joinDef = 62;
226
+ static readonly RULE_joinExpression = 63;
227
+ static readonly RULE_filterStatement = 64;
228
+ static readonly RULE_filteredBy = 65;
229
+ static readonly RULE_filterClauseList = 66;
230
+ static readonly RULE_whereStatement = 67;
231
+ static readonly RULE_havingStatement = 68;
232
+ static readonly RULE_subQueryDefList = 69;
233
+ static readonly RULE_exploreQueryNameDef = 70;
234
+ static readonly RULE_exploreQueryDef = 71;
235
+ static readonly RULE_queryStatement = 72;
236
+ static readonly RULE_queryJoinStatement = 73;
237
+ static readonly RULE_groupByStatement = 74;
238
+ static readonly RULE_queryFieldList = 75;
239
+ static readonly RULE_queryFieldEntry = 76;
240
+ static readonly RULE_nestStatement = 77;
241
+ static readonly RULE_nestedQueryList = 78;
242
+ static readonly RULE_nestEntry = 79;
243
+ static readonly RULE_aggregateStatement = 80;
244
+ static readonly RULE_calculateStatement = 81;
245
+ static readonly RULE_projectStatement = 82;
246
+ static readonly RULE_orderByStatement = 83;
247
+ static readonly RULE_ordering = 84;
248
+ static readonly RULE_orderBySpec = 85;
249
+ static readonly RULE_limitStatement = 86;
250
+ static readonly RULE_bySpec = 87;
251
+ static readonly RULE_topStatement = 88;
252
+ static readonly RULE_indexElement = 89;
253
+ static readonly RULE_indexFields = 90;
254
+ static readonly RULE_indexStatement = 91;
255
+ static readonly RULE_sampleStatement = 92;
256
+ static readonly RULE_timezoneStatement = 93;
257
+ static readonly RULE_queryAnnotation = 94;
258
+ static readonly RULE_sampleSpec = 95;
259
+ static readonly RULE_aggregate = 96;
260
+ static readonly RULE_malloyType = 97;
261
+ static readonly RULE_compareOp = 98;
262
+ static readonly RULE_string = 99;
263
+ static readonly RULE_shortString = 100;
264
+ static readonly RULE_numericLiteral = 101;
265
+ static readonly RULE_literal = 102;
266
+ static readonly RULE_dateLiteral = 103;
267
+ static readonly RULE_tablePath = 104;
268
+ static readonly RULE_tableURI = 105;
269
+ static readonly RULE_id = 106;
270
+ static readonly RULE_timeframe = 107;
271
+ static readonly RULE_ungroup = 108;
272
+ static readonly RULE_malloyOrSQLType = 109;
273
+ static readonly RULE_fieldExpr = 110;
274
+ static readonly RULE_partialAllowedFieldExpr = 111;
275
+ static readonly RULE_pickStatement = 112;
276
+ static readonly RULE_pick = 113;
277
+ static readonly RULE_argumentList = 114;
278
+ static readonly RULE_fieldNameList = 115;
279
+ static readonly RULE_fieldCollection = 116;
280
+ static readonly RULE_collectionWildCard = 117;
281
+ static readonly RULE_starQualified = 118;
282
+ static readonly RULE_taggedRef = 119;
283
+ static readonly RULE_refExpr = 120;
284
+ static readonly RULE_collectionMember = 121;
285
+ static readonly RULE_fieldPath = 122;
286
+ static readonly RULE_joinName = 123;
287
+ static readonly RULE_fieldName = 124;
288
+ static readonly RULE_justExpr = 125;
289
+ static readonly RULE_sqlExploreNameRef = 126;
290
+ static readonly RULE_nameSQLBlock = 127;
291
+ static readonly RULE_connectionName = 128;
292
+ static readonly RULE_experimentalStatementForTesting = 129;
294
293
  static readonly ruleNames: string[];
295
294
  private static readonly _LITERAL_NAMES;
296
295
  private static readonly _SYMBOLIC_NAMES;
@@ -335,7 +334,6 @@ export declare class MalloyParser extends Parser {
335
334
  connectionId(): ConnectionIdContext;
336
335
  queryProperties(): QueryPropertiesContext;
337
336
  filterShortcut(): FilterShortcutContext;
338
- exploreQueryName(): ExploreQueryNameContext;
339
337
  queryName(): QueryNameContext;
340
338
  sourcePropertyList(): SourcePropertyListContext;
341
339
  sourceDefinition(): SourceDefinitionContext;
@@ -711,7 +709,7 @@ export declare class QueryRefinementContext extends ParserRuleContext {
711
709
  queryProperties(): QueryPropertiesContext | undefined;
712
710
  REFINE(): TerminalNode | undefined;
713
711
  refineOperator(): RefineOperatorContext | undefined;
714
- turtleName(): TurtleNameContext | undefined;
712
+ fieldPath(): FieldPathContext | undefined;
715
713
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
716
714
  get ruleIndex(): number;
717
715
  enterRule(listener: MalloyParserListener): void;
@@ -757,7 +755,7 @@ export declare class FirstSegmentContext extends ParserRuleContext {
757
755
  ARROW(): TerminalNode | undefined;
758
756
  queryRefinement(): QueryRefinementContext[];
759
757
  queryRefinement(i: number): QueryRefinementContext;
760
- exploreQueryName(): ExploreQueryNameContext | undefined;
758
+ fieldPath(): FieldPathContext | undefined;
761
759
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
762
760
  get ruleIndex(): number;
763
761
  enterRule(listener: MalloyParserListener): void;
@@ -833,14 +831,6 @@ export declare class FilterShortcutContext extends ParserRuleContext {
833
831
  exitRule(listener: MalloyParserListener): void;
834
832
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
835
833
  }
836
- export declare class ExploreQueryNameContext extends ParserRuleContext {
837
- id(): IdContext;
838
- constructor(parent: ParserRuleContext | undefined, invokingState: number);
839
- get ruleIndex(): number;
840
- enterRule(listener: MalloyParserListener): void;
841
- exitRule(listener: MalloyParserListener): void;
842
- accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
843
- }
844
834
  export declare class QueryNameContext extends ParserRuleContext {
845
835
  id(): IdContext;
846
836
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
@@ -1245,7 +1235,7 @@ export declare class SQSQLContext extends SqExprContext {
1245
1235
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1246
1236
  }
1247
1237
  export declare class LeadSegContext extends ParserRuleContext {
1248
- id(): IdContext | undefined;
1238
+ fieldPath(): FieldPathContext | undefined;
1249
1239
  queryRefinement(): QueryRefinementContext[];
1250
1240
  queryRefinement(i: number): QueryRefinementContext;
1251
1241
  queryProperties(): QueryPropertiesContext | undefined;
@@ -1256,7 +1246,7 @@ export declare class LeadSegContext extends ParserRuleContext {
1256
1246
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
1257
1247
  }
1258
1248
  export declare class QSegContext extends ParserRuleContext {
1259
- id(): IdContext | undefined;
1249
+ fieldPath(): FieldPathContext | undefined;
1260
1250
  queryProperties(): QueryPropertiesContext | undefined;
1261
1251
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
1262
1252
  get ruleIndex(): number;
@@ -1528,7 +1518,7 @@ export declare class NestEntryContext extends ParserRuleContext {
1528
1518
  }
1529
1519
  export declare class NestExistingContext extends NestEntryContext {
1530
1520
  tags(): TagsContext;
1531
- queryName(): QueryNameContext;
1521
+ fieldPath(): FieldPathContext;
1532
1522
  queryRefinement(): QueryRefinementContext[];
1533
1523
  queryRefinement(i: number): QueryRefinementContext;
1534
1524
  constructor(ctx: NestEntryContext);