File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
packages/cubejs-schema-compiler/src/compiler Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -331,8 +331,27 @@ export class CubeSymbols {
331
331
332
332
get joins ( ) {
333
333
if ( ! joins ) {
334
- const parentJoins = cubeDefinition . extends ? super . joins : [ ] ;
335
- joins = [ ...parentJoins , ...( cubeDefinition . joins || [ ] ) ] ;
334
+ // In dynamic models we still can hit the cases where joins are returned as map
335
+ // instead of array, so we need to convert them here to array.
336
+ // TODO: Simplify/Remove this when we drop map joins support totally.
337
+ let parentJoins = cubeDefinition . extends ? super . joins : [ ] ;
338
+ if ( ! Array . isArray ( parentJoins ) ) {
339
+ parentJoins = Object . entries ( parentJoins ) . map ( ( [ name , join ] : [ string , any ] ) => {
340
+ join . name = name ;
341
+ return join as JoinDefinition ;
342
+ } ) ;
343
+ }
344
+
345
+ let localJoins = cubeDefinition . joins || [ ] ;
346
+ // TODO: Simplify/Remove this when we drop map joins support totally.
347
+ if ( ! Array . isArray ( localJoins ) ) {
348
+ localJoins = Object . entries ( localJoins ) . map ( ( [ name , join ] : [ string , any ] ) => {
349
+ join . name = name ;
350
+ return join as JoinDefinition ;
351
+ } ) ;
352
+ }
353
+
354
+ joins = [ ...parentJoins , ...localJoins ] ;
336
355
}
337
356
return joins ;
338
357
} ,
You can’t perform that action at this time.
0 commit comments