@malloydata/malloy 0.0.215 → 0.0.216-dev241118202522
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.
- package/dist/dialect/functions/util.d.ts +8 -8
- package/dist/dialect/functions/util.js +15 -7
- package/dist/lang/ast/ast-utils.js +2 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.js +1 -0
- package/dist/lang/ast/expressions/expr-compare.js +7 -14
- package/dist/lang/ast/expressions/expr-count-distinct.js +1 -0
- package/dist/lang/ast/expressions/expr-count.js +3 -0
- package/dist/lang/ast/expressions/expr-func.js +3 -0
- package/dist/lang/ast/expressions/expr-id-reference.js +10 -1
- package/dist/lang/ast/expressions/expr-now.js +2 -0
- package/dist/lang/ast/expressions/expr-ungroup.js +1 -0
- package/dist/lang/ast/field-space/dynamic-space.d.ts +1 -3
- package/dist/lang/ast/field-space/dynamic-space.js +11 -15
- package/dist/lang/ast/field-space/query-spaces.d.ts +19 -0
- package/dist/lang/ast/field-space/query-spaces.js +104 -12
- package/dist/lang/ast/field-space/reference-field.js +7 -1
- package/dist/lang/ast/field-space/refined-space.d.ts +1 -0
- package/dist/lang/ast/field-space/refined-space.js +9 -6
- package/dist/lang/ast/field-space/struct-space-field-base.js +4 -0
- package/dist/lang/ast/index.d.ts +1 -0
- package/dist/lang/ast/index.js +1 -0
- package/dist/lang/ast/query-builders/index-builder.js +1 -1
- package/dist/lang/ast/query-builders/reduce-builder.d.ts +2 -1
- package/dist/lang/ast/query-builders/reduce-builder.js +9 -5
- package/dist/lang/ast/query-elements/query-base.js +16 -3
- package/dist/lang/ast/query-items/field-declaration.js +3 -0
- package/dist/lang/ast/query-properties/filters.d.ts +3 -0
- package/dist/lang/ast/query-properties/filters.js +42 -26
- package/dist/lang/ast/query-properties/nest.d.ts +1 -0
- package/dist/lang/ast/query-properties/nest.js +5 -1
- package/dist/lang/ast/source-elements/composite-source.d.ts +16 -0
- package/dist/lang/ast/source-elements/composite-source.js +75 -0
- package/dist/lang/ast/source-elements/source.d.ts +2 -2
- package/dist/lang/ast/source-properties/join.js +2 -0
- package/dist/lang/ast/source-query-elements/sq-compose.d.ts +13 -0
- package/dist/lang/ast/source-query-elements/sq-compose.js +48 -0
- package/dist/lang/ast/typedesc-utils.js +7 -1
- package/dist/lang/ast/types/expr-value.js +4 -0
- package/dist/lang/ast/types/expression-def.js +4 -5
- package/dist/lang/ast/types/query-builder.d.ts +2 -1
- package/dist/lang/ast/types/space-field.js +14 -1
- package/dist/lang/ast/types/space-param.js +3 -0
- package/dist/lang/ast/view-elements/reference-view.js +1 -0
- package/dist/lang/ast/view-elements/refine-utils.js +2 -0
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +113 -112
- package/dist/lang/lib/Malloy/MalloyLexer.js +1149 -1143
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +126 -112
- package/dist/lang/lib/Malloy/MalloyParser.js +1380 -1282
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +13 -0
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +8 -0
- package/dist/lang/malloy-to-ast.d.ts +1 -0
- package/dist/lang/malloy-to-ast.js +5 -0
- package/dist/lang/parse-log.d.ts +10 -1
- package/dist/lang/parse-log.js +7 -0
- package/dist/lang/test/composite-field-usage.spec.d.ts +1 -0
- package/dist/lang/test/composite-field-usage.spec.js +155 -0
- package/dist/lang/test/parse-expects.d.ts +2 -1
- package/dist/lang/test/parse-expects.js +36 -0
- package/dist/lang/test/source.spec.js +9 -0
- package/dist/lang/test/test-translator.d.ts +3 -1
- package/dist/lang/test/test-translator.js +15 -4
- package/dist/lang/utils.d.ts +1 -0
- package/dist/lang/utils.js +5 -1
- package/dist/model/composite_source_utils.d.ts +65 -0
- package/dist/model/composite_source_utils.js +279 -0
- package/dist/model/malloy_query.d.ts +3 -3
- package/dist/model/malloy_query.js +13 -6
- package/dist/model/malloy_types.d.ts +19 -2
- package/dist/model/malloy_types.js +15 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.DefinedParameter = exports.AbstractParameter = exports.SpaceParam = void 0;
|
|
49
49
|
const space_entry_1 = require("./space-entry");
|
|
50
50
|
const TDU = __importStar(require("../typedesc-utils"));
|
|
51
|
+
const composite_source_utils_1 = require("../../../model/composite_source_utils");
|
|
51
52
|
class SpaceParam extends space_entry_1.SpaceEntry {
|
|
52
53
|
constructor() {
|
|
53
54
|
super(...arguments);
|
|
@@ -72,6 +73,7 @@ class AbstractParameter extends SpaceParam {
|
|
|
72
73
|
...TDU.atomicDef(this.parameter()),
|
|
73
74
|
expressionType: 'scalar',
|
|
74
75
|
evalSpace: 'constant',
|
|
76
|
+
compositeFieldUsage: (0, composite_source_utils_1.emptyCompositeFieldUsage)(),
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
entryType() {
|
|
@@ -94,6 +96,7 @@ class DefinedParameter extends SpaceParam {
|
|
|
94
96
|
// TODO Not sure whether params are considered "input space". It seems like they
|
|
95
97
|
// could be input or constant, depending on usage (same as above).
|
|
96
98
|
evalSpace: 'input',
|
|
99
|
+
compositeFieldUsage: (0, composite_source_utils_1.emptyCompositeFieldUsage)(),
|
|
97
100
|
};
|
|
98
101
|
}
|
|
99
102
|
entryType() {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.refine = void 0;
|
|
26
26
|
const model_1 = require("../../../model");
|
|
27
|
+
const composite_source_utils_1 = require("../../../model/composite_source_utils");
|
|
27
28
|
const field_utils_1 = require("../../field-utils");
|
|
28
29
|
function refine(logTo, refineTo, refineFrom) {
|
|
29
30
|
var _a, _b;
|
|
@@ -92,6 +93,7 @@ function refine(logTo, refineTo, refineFrom) {
|
|
|
92
93
|
if (overlappingFields.length > 0) {
|
|
93
94
|
logTo.logError('name-conflict-in-refinement', `overlapping fields in refinement: ${overlappingFields.map(field_utils_1.nameFromDef)}`);
|
|
94
95
|
}
|
|
96
|
+
to.compositeFieldUsage = (0, composite_source_utils_1.mergeCompositeFieldUsage)(to.compositeFieldUsage, from.compositeFieldUsage);
|
|
95
97
|
}
|
|
96
98
|
else if (from.type === 'index' && to.type === 'index') {
|
|
97
99
|
to.indexFields = [...from.indexFields, ...to.indexFields];
|
|
@@ -46,118 +46,119 @@ export declare class MalloyLexer extends Lexer {
|
|
|
46
46
|
static readonly CAST = 41;
|
|
47
47
|
static readonly CONDITION = 42;
|
|
48
48
|
static readonly COUNT = 43;
|
|
49
|
-
static readonly
|
|
50
|
-
static readonly
|
|
51
|
-
static readonly
|
|
52
|
-
static readonly
|
|
53
|
-
static readonly
|
|
54
|
-
static readonly
|
|
55
|
-
static readonly
|
|
56
|
-
static readonly
|
|
57
|
-
static readonly
|
|
58
|
-
static readonly
|
|
59
|
-
static readonly
|
|
60
|
-
static readonly
|
|
61
|
-
static readonly
|
|
62
|
-
static readonly
|
|
63
|
-
static readonly
|
|
64
|
-
static readonly
|
|
65
|
-
static readonly
|
|
66
|
-
static readonly
|
|
67
|
-
static readonly
|
|
68
|
-
static readonly
|
|
69
|
-
static readonly
|
|
70
|
-
static readonly
|
|
71
|
-
static readonly
|
|
72
|
-
static readonly
|
|
73
|
-
static readonly
|
|
74
|
-
static readonly
|
|
75
|
-
static readonly
|
|
76
|
-
static readonly
|
|
77
|
-
static readonly
|
|
78
|
-
static readonly
|
|
79
|
-
static readonly
|
|
80
|
-
static readonly
|
|
81
|
-
static readonly
|
|
82
|
-
static readonly
|
|
83
|
-
static readonly
|
|
84
|
-
static readonly
|
|
85
|
-
static readonly
|
|
86
|
-
static readonly
|
|
87
|
-
static readonly
|
|
88
|
-
static readonly
|
|
89
|
-
static readonly
|
|
90
|
-
static readonly
|
|
91
|
-
static readonly
|
|
92
|
-
static readonly
|
|
93
|
-
static readonly
|
|
94
|
-
static readonly
|
|
95
|
-
static readonly
|
|
96
|
-
static readonly
|
|
97
|
-
static readonly
|
|
98
|
-
static readonly
|
|
99
|
-
static readonly
|
|
100
|
-
static readonly
|
|
101
|
-
static readonly
|
|
102
|
-
static readonly
|
|
103
|
-
static readonly
|
|
104
|
-
static readonly
|
|
105
|
-
static readonly
|
|
106
|
-
static readonly
|
|
107
|
-
static readonly
|
|
108
|
-
static readonly
|
|
109
|
-
static readonly
|
|
110
|
-
static readonly
|
|
111
|
-
static readonly
|
|
112
|
-
static readonly
|
|
113
|
-
static readonly
|
|
114
|
-
static readonly
|
|
115
|
-
static readonly
|
|
116
|
-
static readonly
|
|
117
|
-
static readonly
|
|
118
|
-
static readonly
|
|
119
|
-
static readonly
|
|
120
|
-
static readonly
|
|
121
|
-
static readonly
|
|
122
|
-
static readonly
|
|
123
|
-
static readonly
|
|
124
|
-
static readonly
|
|
125
|
-
static readonly
|
|
126
|
-
static readonly
|
|
127
|
-
static readonly
|
|
128
|
-
static readonly
|
|
129
|
-
static readonly
|
|
130
|
-
static readonly
|
|
131
|
-
static readonly
|
|
132
|
-
static readonly
|
|
133
|
-
static readonly
|
|
134
|
-
static readonly
|
|
135
|
-
static readonly
|
|
136
|
-
static readonly
|
|
137
|
-
static readonly
|
|
138
|
-
static readonly
|
|
139
|
-
static readonly
|
|
140
|
-
static readonly
|
|
141
|
-
static readonly
|
|
142
|
-
static readonly
|
|
143
|
-
static readonly
|
|
144
|
-
static readonly
|
|
145
|
-
static readonly
|
|
146
|
-
static readonly
|
|
147
|
-
static readonly
|
|
148
|
-
static readonly
|
|
149
|
-
static readonly
|
|
150
|
-
static readonly
|
|
151
|
-
static readonly
|
|
152
|
-
static readonly
|
|
153
|
-
static readonly
|
|
154
|
-
static readonly
|
|
155
|
-
static readonly
|
|
156
|
-
static readonly
|
|
157
|
-
static readonly
|
|
158
|
-
static readonly
|
|
159
|
-
static readonly
|
|
160
|
-
static readonly
|
|
49
|
+
static readonly COMPOSE = 44;
|
|
50
|
+
static readonly DATE = 45;
|
|
51
|
+
static readonly DAY = 46;
|
|
52
|
+
static readonly DESC = 47;
|
|
53
|
+
static readonly DISTINCT = 48;
|
|
54
|
+
static readonly ELSE = 49;
|
|
55
|
+
static readonly END = 50;
|
|
56
|
+
static readonly EXCLUDE = 51;
|
|
57
|
+
static readonly EXTEND = 52;
|
|
58
|
+
static readonly FALSE = 53;
|
|
59
|
+
static readonly FULL = 54;
|
|
60
|
+
static readonly FOR = 55;
|
|
61
|
+
static readonly FROM = 56;
|
|
62
|
+
static readonly HAS = 57;
|
|
63
|
+
static readonly HOUR = 58;
|
|
64
|
+
static readonly IMPORT = 59;
|
|
65
|
+
static readonly INNER = 60;
|
|
66
|
+
static readonly IS = 61;
|
|
67
|
+
static readonly IN = 62;
|
|
68
|
+
static readonly JSON = 63;
|
|
69
|
+
static readonly LAST = 64;
|
|
70
|
+
static readonly LEFT = 65;
|
|
71
|
+
static readonly LIKE = 66;
|
|
72
|
+
static readonly MAX = 67;
|
|
73
|
+
static readonly MIN = 68;
|
|
74
|
+
static readonly MINUTE = 69;
|
|
75
|
+
static readonly MONTH = 70;
|
|
76
|
+
static readonly NOT = 71;
|
|
77
|
+
static readonly NOW = 72;
|
|
78
|
+
static readonly NULL = 73;
|
|
79
|
+
static readonly NUMBER = 74;
|
|
80
|
+
static readonly ON = 75;
|
|
81
|
+
static readonly OR = 76;
|
|
82
|
+
static readonly PICK = 77;
|
|
83
|
+
static readonly QUARTER = 78;
|
|
84
|
+
static readonly RIGHT = 79;
|
|
85
|
+
static readonly SECOND = 80;
|
|
86
|
+
static readonly STRING = 81;
|
|
87
|
+
static readonly SOURCE_KW = 82;
|
|
88
|
+
static readonly SUM = 83;
|
|
89
|
+
static readonly SQL = 84;
|
|
90
|
+
static readonly TABLE = 85;
|
|
91
|
+
static readonly THEN = 86;
|
|
92
|
+
static readonly THIS = 87;
|
|
93
|
+
static readonly TIMESTAMP = 88;
|
|
94
|
+
static readonly TO = 89;
|
|
95
|
+
static readonly TRUE = 90;
|
|
96
|
+
static readonly TURTLE = 91;
|
|
97
|
+
static readonly WEEK = 92;
|
|
98
|
+
static readonly WHEN = 93;
|
|
99
|
+
static readonly WITH = 94;
|
|
100
|
+
static readonly YEAR = 95;
|
|
101
|
+
static readonly UNGROUPED = 96;
|
|
102
|
+
static readonly STRING_ESCAPE = 97;
|
|
103
|
+
static readonly HACKY_REGEX = 98;
|
|
104
|
+
static readonly SQ_STRING = 99;
|
|
105
|
+
static readonly DQ_STRING = 100;
|
|
106
|
+
static readonly BQ_STRING = 101;
|
|
107
|
+
static readonly DOC_ANNOTATION = 102;
|
|
108
|
+
static readonly ANNOTATION = 103;
|
|
109
|
+
static readonly AMPER = 104;
|
|
110
|
+
static readonly ARROW = 105;
|
|
111
|
+
static readonly FAT_ARROW = 106;
|
|
112
|
+
static readonly OPAREN = 107;
|
|
113
|
+
static readonly CPAREN = 108;
|
|
114
|
+
static readonly OBRACK = 109;
|
|
115
|
+
static readonly CBRACK = 110;
|
|
116
|
+
static readonly OCURLY = 111;
|
|
117
|
+
static readonly CCURLY = 112;
|
|
118
|
+
static readonly DOUBLECOLON = 113;
|
|
119
|
+
static readonly TRIPLECOLON = 114;
|
|
120
|
+
static readonly EXCLAM = 115;
|
|
121
|
+
static readonly COLON = 116;
|
|
122
|
+
static readonly COMMA = 117;
|
|
123
|
+
static readonly DOT = 118;
|
|
124
|
+
static readonly LT = 119;
|
|
125
|
+
static readonly GT = 120;
|
|
126
|
+
static readonly EQ = 121;
|
|
127
|
+
static readonly NE = 122;
|
|
128
|
+
static readonly LTE = 123;
|
|
129
|
+
static readonly GTE = 124;
|
|
130
|
+
static readonly PLUS = 125;
|
|
131
|
+
static readonly MINUS = 126;
|
|
132
|
+
static readonly STAR = 127;
|
|
133
|
+
static readonly STARSTAR = 128;
|
|
134
|
+
static readonly SLASH = 129;
|
|
135
|
+
static readonly BAR = 130;
|
|
136
|
+
static readonly SEMI = 131;
|
|
137
|
+
static readonly NOT_MATCH = 132;
|
|
138
|
+
static readonly MATCH = 133;
|
|
139
|
+
static readonly PERCENT = 134;
|
|
140
|
+
static readonly DOUBLE_QMARK = 135;
|
|
141
|
+
static readonly QMARK = 136;
|
|
142
|
+
static readonly LITERAL_TIMESTAMP = 137;
|
|
143
|
+
static readonly LITERAL_HOUR = 138;
|
|
144
|
+
static readonly LITERAL_DAY = 139;
|
|
145
|
+
static readonly LITERAL_QUARTER = 140;
|
|
146
|
+
static readonly LITERAL_MONTH = 141;
|
|
147
|
+
static readonly LITERAL_WEEK = 142;
|
|
148
|
+
static readonly LITERAL_YEAR = 143;
|
|
149
|
+
static readonly IDENTIFIER = 144;
|
|
150
|
+
static readonly PERCENT_LITERAL = 145;
|
|
151
|
+
static readonly NUMERIC_LITERAL = 146;
|
|
152
|
+
static readonly INTEGER_LITERAL = 147;
|
|
153
|
+
static readonly BLOCK_COMMENT = 148;
|
|
154
|
+
static readonly COMMENT_TO_EOL = 149;
|
|
155
|
+
static readonly WHITE_SPACE = 150;
|
|
156
|
+
static readonly SQL_BEGIN = 151;
|
|
157
|
+
static readonly CLOSE_CODE = 152;
|
|
158
|
+
static readonly UNWATED_CHARS_TRAILING_NUMBERS = 153;
|
|
159
|
+
static readonly UNEXPECTED_CHAR = 154;
|
|
160
|
+
static readonly OPEN_CODE = 155;
|
|
161
|
+
static readonly SQL_END = 156;
|
|
161
162
|
static readonly SQL_MODE = 1;
|
|
162
163
|
static readonly channelNames: string[];
|
|
163
164
|
static readonly modeNames: string[];
|