File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/cubejs-schema-compiler/adapter Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -540,14 +540,18 @@ class PreAggregations {
540540 partitionUnion ( preAggregationForQuery , withoutAlias ) {
541541 const { dimension, partitionDimension } = this . partitionDimension ( preAggregationForQuery ) ;
542542
543- const union = partitionDimension . timeSeries ( ) . map ( range => {
543+ const tables = partitionDimension . timeSeries ( ) . map ( range => {
544544 const preAggregation = this . addPartitionRangeTo ( preAggregationForQuery , dimension , range ) ;
545545 return this . preAggregationTableName (
546546 preAggregationForQuery . cube ,
547547 preAggregationForQuery . preAggregationName ,
548548 preAggregation . preAggregation
549549 ) ;
550- } ) . map ( table => `SELECT * FROM ${ table } ` ) . join ( " UNION ALL " ) ;
550+ } ) ;
551+ if ( tables . length === 1 ) {
552+ return tables [ 0 ] ;
553+ }
554+ const union = tables . map ( table => `SELECT * FROM ${ table } ` ) . join ( " UNION ALL " ) ;
551555 return `(${ union } )${ withoutAlias ? '' : ' as partition_union' } ` ;
552556 }
553557}
You can’t perform that action at this time.
0 commit comments