Skip to content

Commit

Permalink
Revert "allow join_many: with (#1950)" (#1951)
Browse files Browse the repository at this point in the history
This reverts commit 9f3b0db.
  • Loading branch information
mtoy-googly-moogly authored Oct 7, 2024
1 parent 9f3b0db commit 06dca1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions packages/malloy/src/lang/malloy-to-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ export class MalloyToAST
'join_many: requires ON expression'
);
}
} else if (join instanceof ast.KeyJoin) {
this.contextError(
pcx,
'foreign-key-in-join-many',
'Foreign key join not legal in join_many:'
);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/malloy/src/lang/parse-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ type MessageParameterTypes = {
'failed-to-parse-time-literal': string;
'table-function': string;
'missing-on-in-join-many': string;
'foreign-key-in-join-many': string;
'join-statement-in-view': string;
'unknown-matrix-operation': string;
'declare': string;
Expand Down
12 changes: 5 additions & 7 deletions packages/malloy/src/lang/test/source.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ describe('source:', () => {
'source: nab is a extend { join_many: b on astr = b.astr }'
).toTranslate();
});
test('many with', () => {
expect(
model`source: nab is a extend { ${'join_many: b with astr'} }`
).toLog(errorMessage('Foreign key join not legal in join_many:'));
});
test('many is on', () => {
expect(
'source: y is a extend { join_many: x is b on astr = x.astr }'
Expand Down Expand Up @@ -231,13 +236,6 @@ describe('source:', () => {
}
`).toTranslate();
});
test('join-many: with is ok', () => {
expect(`
source: awithmany is a extend {
join_many: manyb is a with astr
}
`).toTranslate();
});
});
test('primary_key', () => {
expect('source: c is a extend { primary_key: ai }').toTranslate();
Expand Down

0 comments on commit 06dca1d

Please sign in to comment.