Skip to content

Commit 09309d0

Browse files
committed
in work
1 parent 00f9f25 commit 09309d0

File tree

12 files changed

+255
-154
lines changed

12 files changed

+255
-154
lines changed

packages/cubejs-schema-compiler/src/adapter/BaseDimension.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { BaseQuery } from './BaseQuery';
22
import type { DimensionDefinition, SegmentDefinition } from '../compiler/CubeEvaluator';
3-
import { CubeSymbols } from "../compiler/CubeSymbols";
3+
import { CubeSymbols } from '../compiler/CubeSymbols';
44

55
export class BaseDimension {
66
public readonly expression: any;
@@ -28,6 +28,7 @@ export class BaseDimension {
2828
const dimensionPath = dimension as string | null;
2929
if (dimensionPath !== null) {
3030
const { path, joinHint } = CubeSymbols.joinHintFromPath(dimensionPath);
31+
console.log("!!! dimension", dimensionPath, path, joinHint);
3132
this.dimension = path;
3233
this.joinHint = joinHint;
3334
}

packages/cubejs-schema-compiler/src/adapter/BaseMeasure.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { UserError } from '../compiler/UserError';
22
import type { BaseQuery } from './BaseQuery';
33
import { MeasureDefinition } from '../compiler/CubeEvaluator';
4-
import { CubeSymbols } from "../compiler/CubeSymbols";
4+
import { CubeSymbols } from '../compiler/CubeSymbols';
55

66
export class BaseMeasure {
77
public readonly expression: any;

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

+9-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
timeSeriesFromCustomInterval
2525
} from '@cubejs-backend/shared';
2626

27-
import { CubeSymbols } from "../compiler/CubeSymbols";
27+
import { CubeSymbols } from '../compiler/CubeSymbols';
2828
import { UserError } from '../compiler/UserError';
2929
import { SqlParser } from '../parser/SqlParser';
3030
import { BaseDimension } from './BaseDimension';
@@ -637,8 +637,8 @@ export class BaseQuery {
637637
*/
638638
buildSqlAndParams(exportAnnotatedSql) {
639639
if (this.useNativeSqlPlanner) {
640-
let isRelatedToPreAggregation = false;
641-
/* if (this.options.preAggregationQuery) {
640+
const isRelatedToPreAggregation = false;
641+
/* if (this.options.preAggregationQuery) {
642642
isRelatedToPreAggregation = true;
643643
} else if (!this.options.disableExternalPreAggregations && this.externalQueryClass) {
644644
if (this.externalPreAggregationQuery()) {
@@ -659,9 +659,11 @@ export class BaseQuery {
659659
return this.newQueryWithoutNative().buildSqlAndParams(exportAnnotatedSql);
660660
} */
661661

662+
console.log("!!!!!! EEEEEEEEEE");
662663
return this.buildSqlAndParamsRust(exportAnnotatedSql);
663664
}
664665

666+
console.log("!!!!!! RRRRRRRRR");
665667
if (!this.options.preAggregationQuery && !this.options.disableExternalPreAggregations && this.externalQueryClass) {
666668
if (this.externalPreAggregationQuery()) { // TODO performance
667669
return this.externalQuery().buildSqlAndParams(exportAnnotatedSql);
@@ -726,17 +728,15 @@ export class BaseQuery {
726728
return res;
727729
}
728730

729-
//FIXME Temporary solution
731+
// FIXME Temporary solution
730732
findPreAggregationForQueryRust() {
731733
if (!this.preAggregations.preAggregationForQuery) {
732734
let optionsOrder = this.options.order;
733735
if (optionsOrder && !Array.isArray(optionsOrder)) {
734736
optionsOrder = [optionsOrder];
735737
}
736738
const order = optionsOrder ? R.pipe(
737-
R.map((hash) => {
738-
return ((!hash || !hash.id) ? null : hash);
739-
}),
739+
R.map((hash) => ((!hash || !hash.id) ? null : hash)),
740740
R.reject(R.isNil),
741741
)(optionsOrder) : undefined;
742742

@@ -769,7 +769,7 @@ export class BaseQuery {
769769
}
770770
}
771771

772-
const res = buildResult.result;
772+
const res = buildResult.result;
773773
if (res[2]) {
774774
this.preAggregations.preAggregationForQuery = res[2];
775775
}
@@ -973,7 +973,6 @@ export class BaseQuery {
973973
multiStageMembers,
974974
} = this.fullKeyQueryAggregateMeasures();
975975

976-
977976
if (!multipliedMeasures.length && !cumulativeMeasures.length && !multiStageMembers.length) {
978977
return this.simpleQuery();
979978
}
@@ -1211,7 +1210,6 @@ export class BaseQuery {
12111210

12121211
const multipliedMeasures = measuresToRender(true, false)(measureToHierarchy);
12131212
const regularMeasures = measuresToRender(false, false)(measureToHierarchy);
1214-
12151213
const cumulativeMeasures =
12161214
R.pipe(
12171215
R.map(multiplied => R.xprod([multiplied], measuresToRender(multiplied, true)(measureToHierarchy))),
@@ -1335,6 +1333,7 @@ export class BaseQuery {
13351333

13361334
childrenMultiStageContext(memberPath, queryContext, wouldNodeApplyFilters) {
13371335
let member;
1336+
console.log("!!!! children ", memberPath);
13381337
if (this.cubeEvaluator.isMeasure(memberPath)) {
13391338
member = this.newMeasure(memberPath);
13401339
} else if (this.cubeEvaluator.isDimension(memberPath)) {

packages/cubejs-schema-compiler/src/adapter/BaseSegment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { BaseQuery } from './BaseQuery';
2-
import { CubeSymbols } from "../compiler/CubeSymbols";
2+
import { CubeSymbols } from '../compiler/CubeSymbols';
33

44
export class BaseSegment {
55
public readonly expression: any;

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import R from 'ramda';
22
import { FROM_PARTITION_RANGE, getEnv, TO_PARTITION_RANGE } from '@cubejs-backend/shared';
33

4-
import { CubeSymbols } from "../compiler/CubeSymbols";
4+
import { CubeSymbols } from '../compiler/CubeSymbols';
55
import { UserError } from '../compiler/UserError';
66

77
export class PreAggregations {
@@ -21,6 +21,7 @@ export class PreAggregations {
2121
* @return {unknown[]}
2222
*/
2323
preAggregationsDescription() {
24+
return [];
2425
const preAggregations = [this.preAggregationsDescriptionLocal()].concat(
2526
this.query.subQueryDimensions.map(d => this.query.subQueryDescription(d).subQuery)
2627
.map(q => q.preAggregations.preAggregationsDescription())
@@ -311,8 +312,8 @@ export class PreAggregations {
311312
const dimensionsList = query.dimensions.map(dim => dim.expressionPath());
312313
const segmentsList = query.segments.map(s => s.expressionPath());
313314
const ownedDimensions = PreAggregations.ownedMembers(query, flattenDimensionMembers);
314-
console.log("!!! dimensions", dimensionsList);
315-
console.log("!!! ownedDimensions", ownedDimensions);
315+
console.log('!!! dimensions', dimensionsList);
316+
console.log('!!! ownedDimensions', ownedDimensions);
316317
const ownedTimeDimensions = query.timeDimensions.map(td => {
317318
const owned = PreAggregations.ownedMembers(query, [td]);
318319
let { dimension } = td;
@@ -833,6 +834,7 @@ export class PreAggregations {
833834
* @returns {Array<Object>}
834835
*/
835836
rollupMatchResults() {
837+
return [];
836838
const { query } = this;
837839

838840
const canUsePreAggregation = this.canUsePreAggregationFn(query);

packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts

+1
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ export class CubeEvaluator extends CubeSymbols {
670670

671671
const cubeAndName = Array.isArray(path) ? path : path.split('.');
672672
if (!this.evaluatedCubes[cubeAndName[0]]) {
673+
console.trace("!!!!");
673674
throw new UserError(`Cube '${cubeAndName[0]}' not found for path '${path}'`);
674675
}
675676

0 commit comments

Comments
 (0)