Commit 7c0f8b9
fix: use per-query cache for masked members with SQL masks in collectFrom
When a member has a mask.sql (not a static mask), evaluateSymbolSql
takes a different code path that may reference members from other cubes
requiring additional joins. The compilerCache is shared across queries
and doesn't account for masking state, causing stale join hints when
the same member was first collected without masking.
Fix: use this.queryCache (per-query, keyed by maskedMembers) instead
of this.compilerCache specifically for members that have mask.sql.
Static masks (numbers, booleans, strings) continue using the shared
compilerCache since they don't change join dependencies.
Also fix joined mask test assertions to only query masked_order_id
(order_id has no mask definition so it gets default NULL mask).
Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>1 parent a2a6fc9 commit 7c0f8b9
2 files changed
Lines changed: 18 additions & 16 deletions
File tree
- packages
- cubejs-schema-compiler/src/adapter
- cubejs-testing/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2846 | 2846 | | |
2847 | 2847 | | |
2848 | 2848 | | |
2849 | | - | |
2850 | | - | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
2851 | 2856 | | |
2852 | | - | |
| 2857 | + | |
2853 | 2858 | | |
2854 | 2859 | | |
2855 | | - | |
2856 | | - | |
| 2860 | + | |
| 2861 | + | |
2857 | 2862 | | |
2858 | 2863 | | |
2859 | 2864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
867 | | - | |
| 866 | + | |
| 867 | + | |
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
977 | | - | |
| 977 | + | |
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
982 | | - | |
983 | | - | |
984 | | - | |
| 982 | + | |
| 983 | + | |
985 | 984 | | |
986 | 985 | | |
987 | 986 | | |
| |||
1165 | 1164 | | |
1166 | 1165 | | |
1167 | 1166 | | |
1168 | | - | |
| 1167 | + | |
1169 | 1168 | | |
1170 | 1169 | | |
1171 | 1170 | | |
| |||
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
1238 | | - | |
| 1237 | + | |
1239 | 1238 | | |
1240 | 1239 | | |
1241 | 1240 | | |
1242 | 1241 | | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
| 1242 | + | |
1246 | 1243 | | |
1247 | 1244 | | |
1248 | 1245 | | |
| |||
0 commit comments