Skip to content

Commit ef08b6a

Browse files
committed
update
1 parent e597ab3 commit ef08b6a

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

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

+4-27
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import cronParser from 'cron-parser';
1111

1212
import moment from 'moment-timezone';
1313
import inflection from 'inflection';
14-
import { FROM_PARTITION_RANGE, inDbTimeZone, MAX_SOURCE_ROW_LIMIT, QueryAlias, getEnv, timeSeries } from '@cubejs-backend/shared';
14+
import { FROM_PARTITION_RANGE, inDbTimeZone, MAX_SOURCE_ROW_LIMIT, QueryAlias, getEnv, timeSeries as timeSeriesBase } from '@cubejs-backend/shared';
1515

1616
import {
1717
buildSqlAndParams as nativeBuildSqlAndParams,
@@ -576,29 +576,6 @@ export class BaseQuery {
576576
return false;
577577
}
578578

579-
buildSqlAndParamsTest(exportAnnotatedSql) {
580-
if (!this.options.preAggregationQuery && !this.options.disableExternalPreAggregations && this.externalQueryClass) {
581-
if (this.externalPreAggregationQuery()) { // TODO performance
582-
return this.externalQuery().buildSqlAndParams(exportAnnotatedSql);
583-
}
584-
}
585-
const js_res = this.compilers.compiler.withQuery(
586-
this,
587-
() => this.cacheValue(
588-
['buildSqlAndParams', exportAnnotatedSql],
589-
() => this.paramAllocator.buildSqlAndParams(
590-
this.buildParamAnnotatedSql(),
591-
exportAnnotatedSql,
592-
this.shouldReuseParams
593-
),
594-
{ cache: this.queryCache }
595-
)
596-
);
597-
const rust = this.buildSqlAndParamsRust(exportAnnotatedSql);
598-
console.log('js result: ', js_res[0]);
599-
console.log('rust result: ', rust[0]);
600-
return js_res;
601-
}
602579
/**
603580
* Returns a pair of SQL query string and parameter values for the query.
604581
* @param {boolean} [exportAnnotatedSql] - returns annotated sql with not rendered params if true
@@ -651,10 +628,11 @@ export class BaseQuery {
651628
return res;
652629
}
653630

654-
//FIXME helper for native generator, maybe should be moved entire to rust
631+
// FIXME helper for native generator, maybe should be moved entire to rust
655632
generateTimeSeries(granularity, dateRange) {
656-
return timeSeries(granularity, dateRange);
633+
return timeSeriesBase(granularity, dateRange);
657634
}
635+
658636
get shouldReuseParams() {
659637
return false;
660638
}
@@ -1419,7 +1397,6 @@ export class BaseQuery {
14191397
)
14201398
).join(' AND ');
14211399

1422-
14231400
return this.overTimeSeriesSelect(
14241401
cumulativeMeasures,
14251402
dateSeriesSql,

packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ describe('SQL Generation', () => {
666666
console.log(query.buildSqlAndParams());
667667

668668
// TODO ordering doesn't work for running total
669-
return dbRunner.testQuery(query.buildSqlAndParamsTest()).then(res => {
669+
return dbRunner.testQuery(query.buildSqlAndParams()).then(res => {
670670
console.log(JSON.stringify(res));
671671
expect(res).toEqual(
672672
[{
@@ -916,7 +916,6 @@ describe('SQL Generation', () => {
916916
{ visitors__created_at_day: '2017-01-10T00:00:00.000Z', visitors__running_revenue_per_count: '300' }
917917
]));
918918

919-
920919
it('hll rolling (BigQuery)', async () => {
921920
await compiler.compile();
922921

0 commit comments

Comments
 (0)