Skip to content

Commit 798cb6a

Browse files
committed
fix
1 parent 57571be commit 798cb6a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

+5-7
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ export class BaseQuery {
476476
}
477477

478478
newDimension(dimensionPath) {
479-
if (dimensionPath instanceof String || typeof dimensionPath === 'string') {
480-
const memberArr = Array.isArray(dimensionPath) ? dimensionPath : dimensionPath.split('.');
479+
if (typeof dimensionPath === 'string') {
480+
const memberArr = dimensionPath.split('.');
481481
if (memberArr.length > 3 &&
482482
memberArr[memberArr.length - 2] === 'granularities' &&
483483
this.cubeEvaluator.isDimension(memberArr.slice(0, -2))) {
@@ -660,10 +660,8 @@ export class BaseQuery {
660660
if (!this.canUseNativeSqlPlannerPreAggregation) {
661661
if (this.options.preAggregationQuery) {
662662
isRelatedToPreAggregation = true;
663-
} else if (!this.options.disableExternalPreAggregations && this.externalQueryClass) {
664-
if (this.externalPreAggregationQuery()) {
665-
isRelatedToPreAggregation = true;
666-
}
663+
} else if (!this.options.disableExternalPreAggregations && this.externalQueryClass && this.externalPreAggregationQuery()) {
664+
isRelatedToPreAggregation = true;
667665
} else {
668666
let preAggForQuery =
669667
this.preAggregations.findPreAggregationForQuery();
@@ -782,7 +780,7 @@ export class BaseQuery {
782780
const buildResult = nativeBuildSqlAndParams(queryParams);
783781

784782
if (buildResult.error) {
785-
if (buildResult.error.cause && buildResult.error.cause === 'User') {
783+
if (buildResult.error.cause === 'User') {
786784
throw new UserError(buildResult.error.message);
787785
} else {
788786
throw new Error(buildResult.error.message);

0 commit comments

Comments
 (0)