Skip to content

Commit d971e8d

Browse files
fix: include maskedMembers in collectFrom cache key for correct join resolution
When a member is masked, evaluateSymbolSql takes a different path (mask.sql instead of regular sql), which may reference different cubes requiring different joins. The compilerCache was caching the collection results without considering masking state, causing stale join hints when the same member was first collected without masking and then with masking. Add 'masked' suffix to the cache key for masked members so that masked and unmasked collection results are cached separately. Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
1 parent a2a6fc9 commit d971e8d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,6 +2850,8 @@ export class BaseQuery {
28502850
(cache || this.compilerCache).cache(
28512851
['collectFrom'].concat(methodCacheKey).concat(
28522852
s.path() ? [s.path().join('.')] : [s.cube().name, s.expression?.toString() || s.expressionName || s.definition().sql]
2853+
).concat(
2854+
s.path() && this.maskedMembers && this.maskedMembers.has(s.path().join('.')) ? ['masked'] : []
28532855
),
28542856
() => fn(() => this.traverseSymbol(s))
28552857
)

0 commit comments

Comments
 (0)