Skip to content

Commit 417da79

Browse files
committed
pass cubeJoinsResolver to YamlCompiler
1 parent fc7f779 commit 417da79

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/cubejs-schema-compiler/src/compiler/PrepareCompiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const prepareCompiler = (repo: SchemaFileRepository, options: PrepareComp
5757
const metaTransformer = new CubeToMetaTransformer(cubeValidator, cubeEvaluator, contextEvaluator, joinGraph);
5858
const { maxQueryCacheSize, maxQueryCacheAge } = options;
5959
const compilerCache = new CompilerCache({ maxQueryCacheSize, maxQueryCacheAge });
60-
const yamlCompiler = new YamlCompiler(cubeSymbols, cubeDictionary, nativeInstance, viewCompiler);
60+
const yamlCompiler = new YamlCompiler(cubeSymbols, cubeDictionary, nativeInstance, viewCompiler, cubeJoinsResolver);
6161

6262
const compiledScriptCache = options.compiledScriptCache || new LRUCache<string, vm.Script>({ max: 250 });
6363

packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { nonStringFields } from './CubeValidator';
1616
import { CubeDictionary } from './CubeDictionary';
1717
import { ErrorReporter } from './ErrorReporter';
1818
import { camelizeCube } from './utils';
19+
import { CubeJoinsResolver } from './CubeJoinsResolver';
1920

2021
type EscapeStateStack = {
2122
inFormattedStr?: boolean;
@@ -34,6 +35,7 @@ export class YamlCompiler {
3435
private readonly cubeDictionary: CubeDictionary,
3536
private readonly nativeInstance: NativeInstance,
3637
private readonly viewCompiler: CubeSymbols,
38+
private readonly cubeJoinsResolver: CubeJoinsResolver,
3739
) {
3840
}
3941

@@ -301,7 +303,8 @@ export class YamlCompiler {
301303

302304
resolveSymbol = resolveSymbol || (n => this.viewCompiler.resolveSymbol(cubeName, n) ||
303305
this.cubeSymbols.resolveSymbol(cubeName, n) ||
304-
this.cubeSymbols.isCurrentCube(n));
306+
this.cubeSymbols.isCurrentCube(n) ||
307+
this.cubeJoinsResolver.resolveSymbol(cubeName, n));
305308

306309
const traverseObj = {
307310
Program: (babelPath) => {

0 commit comments

Comments
 (0)