@malloydata/malloy 0.0.98-dev231027183449 → 0.0.98
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.
|
@@ -362,19 +362,19 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
362
362
|
return this.astAt(expr, pcx);
|
|
363
363
|
}
|
|
364
364
|
visitDefJoinMany(pcx) {
|
|
365
|
-
const joinList = this.getJoinList(pcx.joinList());
|
|
366
365
|
const joins = [];
|
|
367
|
-
for (const
|
|
366
|
+
for (const joinCx of pcx.joinList().joinDef()) {
|
|
367
|
+
const join = this.visit(joinCx);
|
|
368
368
|
if (join instanceof ast.Join) {
|
|
369
369
|
joins.push(join);
|
|
370
370
|
if (join instanceof ast.ExpressionJoin) {
|
|
371
371
|
join.joinType = 'many';
|
|
372
372
|
if (join.joinOn === undefined) {
|
|
373
|
-
|
|
373
|
+
this.contextError(pcx, 'join_many: requires ON expression');
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
else if (join instanceof ast.KeyJoin) {
|
|
377
|
-
|
|
377
|
+
this.contextError(pcx, 'Foreign key join not legal in join_many:');
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
}
|
|
@@ -140,6 +140,9 @@ describe('source:', () => {
|
|
|
140
140
|
test('many on', () => {
|
|
141
141
|
expect('source: nab is a extend { join_many: b on astr = b.astr }').toTranslate();
|
|
142
142
|
});
|
|
143
|
+
test('many with', () => {
|
|
144
|
+
expect((0, test_translator_1.model) `source: nab is a extend { ${'join_many: b with astr'} }`).translationToFailWith('Foreign key join not legal in join_many:');
|
|
145
|
+
});
|
|
143
146
|
test('many is on', () => {
|
|
144
147
|
expect('source: y is a extend { join_many: x is b on astr = x.astr }').toTranslate();
|
|
145
148
|
});
|