Skip to content

feat(tesseract): Basic pre-aggregations support #9434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: tesseract-logical-plan
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/cubejs-schema-compiler/src/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@
}

if (this.useNativeSqlPlanner) {
let isRelatedToPreAggregation = false;
/* let isRelatedToPreAggregation = false;
if (this.options.preAggregationQuery) {
isRelatedToPreAggregation = true;
} else if (!this.options.disableExternalPreAggregations && this.externalQueryClass) {
Expand All @@ -658,7 +658,7 @@

if (isRelatedToPreAggregation) {
return this.newQueryWithoutNative().buildSqlAndParams(exportAnnotatedSql);
}
} */

return this.buildSqlAndParamsRust(exportAnnotatedSql);
}
Expand Down Expand Up @@ -698,8 +698,8 @@
offset: this.options.offset ? this.options.offset.toString() : null,
baseTools: this,
ungrouped: this.options.ungrouped,
exportAnnotatedSql: exportAnnotatedSql === true

exportAnnotatedSql: exportAnnotatedSql === true,
preAggregationQuery: this.options.preAggregationQuery
};

const buildResult = nativeBuildSqlAndParams(queryParams);
Expand All @@ -715,6 +715,9 @@
const res = buildResult.result;
// FIXME
res[1] = [...res[1]];
if (res[2]) {
this.preAggregations.preAggregationForQuery = res[2];

Check warning on line 719 in packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-schema-compiler/src/adapter/BaseQuery.js#L718-L719

Added lines #L718 - L719 were not covered by tests
}
return res;
}

Expand All @@ -738,6 +741,10 @@
return timeSeriesFromCustomInterval(granularityInterval, dateRange, moment(origin), { timestampPrecision: 3 });
}

getPreAggregationByName(cube, preAggregationName) {
return this.preAggregations.getRollupPreAggregationByName(cube, preAggregationName);

Check warning on line 745 in packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

View check run for this annotation

Codecov / codecov/patch

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

Added line #L745 was not covered by tests
}

get shouldReuseParams() {
return false;
}
Expand Down
25 changes: 24 additions & 1 deletion packages/cubejs-schema-compiler/src/adapter/PreAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
transformedQuery.filterDimensionsSingleValueEqual || {},
)
));

const backAlias = (references) => references.map(r => (
Array.isArray(r) ?
[transformedQuery.allBackAliasMembers[r[0]] || r[0], r[1]] :
Expand Down Expand Up @@ -819,6 +819,29 @@
)(preAggregations);
}

getRollupPreAggregationByName(cube, preAggregationName) {
const canUsePreAggregation = () => true;
const preAggregation = R.pipe(

Check warning on line 824 in packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-schema-compiler/src/adapter/PreAggregations.js#L823-L824

Added lines #L823 - L824 were not covered by tests
R.toPairs,
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
R.filter(([k, a]) => a.type === 'rollup' || a.type === 'rollupJoin' || a.type === 'rollupLambda'),

Check warning on line 828 in packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

View check run for this annotation

Codecov / codecov/patch

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

Added line #L828 was not covered by tests
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
R.find(([k, a]) => k === preAggregationName)

Check warning on line 831 in packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

View check run for this annotation

Codecov / codecov/patch

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

Added line #L831 was not covered by tests
)(this.query.cubeEvaluator.preAggregationsForCube(cube));
if (preAggregation) {
const tableName = this.preAggregationTableName(cube, preAggregation[0], preAggregation[1]);
const preAggObj = preAggregation ? this.evaluatedPreAggregationObj(cube, preAggregation[0], preAggregation[1], canUsePreAggregation) : {};
return {

Check warning on line 836 in packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-schema-compiler/src/adapter/PreAggregations.js#L833-L836

Added lines #L833 - L836 were not covered by tests
tableName,
...preAggObj
};
} else {
return {};

Check warning on line 841 in packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

View check run for this annotation

Codecov / codecov/patch

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

Added line #L841 was not covered by tests
}
}

// TODO check multiplication factor didn't change
buildRollupJoin(preAggObj, preAggObjsToJoin) {
return this.query.cacheValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ export class CubeEvaluator extends CubeSymbols {
return this.cubeFromPath(path).preAggregations || {};
}

public preAggregationsForCubeAsArray(path: string) {
return Object.entries(this.cubeFromPath(path).preAggregations || {}).map(([name, preAggregation]) => ({
name,
...(preAggregation as Record<string, any>)
}));
}

/**
* Returns pre-aggregations filtered by the specified selector.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ describe('PreAggregations', () => {
});
`);

it('simple pre-aggregation', () => compiler.compile().then(() => {
it('simple pre-aggregation 1', () => compiler.compile().then(() => {
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
measures: [
'visitors.count'
Expand All @@ -513,6 +513,12 @@ describe('PreAggregations', () => {
preAggregationsSchema: ''
});

const queryAndParams = query.buildSqlAndParams();
console.log(queryAndParams);
console.log("!!!! pre aggrs", query.preAggregations?.preAggregationForQuery);
console.log("!!!! pre aggrs fun", query.preAggregations?.preAggregationForQuery.preAggregation);
expect(query.preAggregations?.preAggregationForQuery?.canUsePreAggregation).toEqual(true);

return dbRunner.evaluateQueryWithPreAggregations(query).then(res => {
expect(res).toEqual(
[
Expand Down Expand Up @@ -880,7 +886,7 @@ describe('PreAggregations', () => {
});
}));

it('multiplied measure match', () => compiler.compile().then(() => {
it('multiplied measure match 1', () => compiler.compile().then(() => {
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
measures: [
'visitors.count'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ export class BaseDbRunner {

public async evaluateQueryWithPreAggregations(query, seed = this.nextSeed++) {
const preAggregationsDescription = query.preAggregations?.preAggregationsDescription();
// console.log(preAggregationsDescription);

await Promise.all(preAggregationsDescription.map(
async desc => {
if (desc.partitionGranularity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub struct BaseQueryOptionsStatic {
pub ungrouped: Option<bool>,
#[serde(rename = "exportAnnotatedSql")]
pub export_annotated_sql: bool,
#[serde(rename = "preAggregationQuery")]
pub pre_aggregation_query: Option<bool>,
}

#[nativebridge::native_bridge(BaseQueryOptionsStatic)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use super::base_query_options::FilterItem;

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs
use super::filter_group::{FilterGroup, NativeFilterGroup};
use super::filter_params::{FilterParams, NativeFilterParams};
use cubenativeutils::wrappers::NativeArray;

Check warning on line 4 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / Build native Linux 22 x86_64-unknown-linux-gnu Python fallback

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 4 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 4 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, snowflake, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 4 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, bigquery, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 4 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, athena, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`
use super::security_context::{NativeSecurityContext, SecurityContext};
use super::sql_templates_render::{NativeSqlTemplatesRender, SqlTemplatesRender};
use super::pre_aggregation_obj::{NativePreAggregationObj, PreAggregationObj};
use super::sql_utils::{NativeSqlUtils, SqlUtils};
use cubenativeutils::wrappers::serializer::{
NativeDeserialize, NativeDeserializer, NativeSerialize,
};

Check warning on line 11 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs
use cubenativeutils::wrappers::NativeContextHolder;
use cubenativeutils::wrappers::NativeObjectHandle;
use cubenativeutils::CubeError;
Expand Down Expand Up @@ -56,6 +58,8 @@
&self,
interval: String,
source: String,
origin: String,

Check warning on line 61 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/base_tools.rs
) -> Result<String, CubeError>;

fn get_pre_aggregation_by_name(&self, cube_name: String, name: String) -> Result<Rc<dyn PreAggregationObj>, CubeError>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ use super::dimension_definition::{
};
use super::measure_definition::{MeasureDefinition, NativeMeasureDefinition};
use super::member_sql::{MemberSql, NativeMemberSql};
use super::pre_aggregation_description::{
NativePreAggregationDescription, PreAggregationDescription,
};
use super::segment_definition::{NativeSegmentDefinition, SegmentDefinition};
use cubenativeutils::wrappers::serializer::{
NativeDeserialize, NativeDeserializer, NativeSerialize,
};
use cubenativeutils::wrappers::NativeArray;
use cubenativeutils::wrappers::NativeContextHolder;
use cubenativeutils::wrappers::NativeObjectHandle;
use cubenativeutils::CubeError;
Expand Down Expand Up @@ -51,4 +55,9 @@ pub trait CubeEvaluator {
sql: Rc<dyn MemberSql>,
) -> Result<Vec<CallDep>, CubeError>;
fn resolve_granularity(&self, path: Vec<String>) -> Result<GranularityDefinition, CubeError>;
#[nbridge(vec)]
fn pre_aggregations_for_cube_as_array(
&self,
cube_name: String,
) -> Result<Vec<Rc<dyn PreAggregationDescription>>, CubeError>;
}
2 changes: 2 additions & 0 deletions rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
pub mod member_definition;
pub mod member_expression;
pub mod member_order_by;
pub mod member_sql;

Check warning on line 22 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs
pub mod options_member;
pub mod pre_aggregation_description;
pub mod security_context;
pub mod segment_definition;
pub mod sql_templates_render;
pub mod sql_utils;

Check warning on line 28 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs
pub mod struct_with_sql_member;
pub mod pre_aggregation_obj;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use super::member_sql::{MemberSql, NativeMemberSql};
use cubenativeutils::wrappers::serializer::{
NativeDeserialize, NativeDeserializer, NativeSerialize,
};
use cubenativeutils::wrappers::NativeArray;

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_description.rs

View workflow job for this annotation

GitHub Actions / Build native Linux 22 x86_64-unknown-linux-gnu Python fallback

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_description.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_description.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, snowflake, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_description.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, bigquery, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_description.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, athena, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`
use cubenativeutils::wrappers::NativeContextHolder;
use cubenativeutils::wrappers::NativeObjectHandle;
use cubenativeutils::CubeError;
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::rc::Rc;

#[derive(Serialize, Deserialize, Debug)]
pub struct PreAggregationDescriptionStatic {
pub name: String,
#[serde(rename = "type")]
pub pre_aggregation_type: String,
pub granularity: Option<String>,
pub external: Option<bool>,
}

#[nativebridge::native_bridge(PreAggregationDescriptionStatic)]
pub trait PreAggregationDescription {
#[nbridge(field, optional)]
fn measure_references(&self) -> Result<Option<Rc<dyn MemberSql>>, CubeError>;

#[nbridge(field, optional)]
fn dimension_references(&self) -> Result<Option<Rc<dyn MemberSql>>, CubeError>;

#[nbridge(field, optional)]
fn time_dimension_reference(&self) -> Result<Option<Rc<dyn MemberSql>>, CubeError>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use super::member_sql::{MemberSql, NativeMemberSql};

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native Linux 22 x86_64-unknown-linux-gnu Python fallback

unused imports: `MemberSql` and `NativeMemberSql`

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused imports: `MemberSql` and `NativeMemberSql`

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, snowflake, x86_64-unknown-linux-gnu)

unused imports: `MemberSql` and `NativeMemberSql`

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, bigquery, x86_64-unknown-linux-gnu)

unused imports: `MemberSql` and `NativeMemberSql`

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, athena, x86_64-unknown-linux-gnu)

unused imports: `MemberSql` and `NativeMemberSql`
use cubenativeutils::wrappers::serializer::{
NativeDeserialize, NativeDeserializer, NativeSerialize,

Check warning on line 3 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native Linux 22 x86_64-unknown-linux-gnu Python fallback

unused import: `NativeDeserializer`

Check warning on line 3 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `NativeDeserializer`

Check warning on line 3 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, snowflake, x86_64-unknown-linux-gnu)

unused import: `NativeDeserializer`

Check warning on line 3 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, bigquery, x86_64-unknown-linux-gnu)

unused import: `NativeDeserializer`

Check warning on line 3 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, athena, x86_64-unknown-linux-gnu)

unused import: `NativeDeserializer`
};
use cubenativeutils::wrappers::NativeArray;

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native Linux 22 x86_64-unknown-linux-gnu Python fallback

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, snowflake, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, bigquery, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`

Check warning on line 5 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / integration-cloud (22.x, athena, x86_64-unknown-linux-gnu)

unused import: `cubenativeutils::wrappers::NativeArray`
use cubenativeutils::wrappers::NativeContextHolder;
use cubenativeutils::wrappers::NativeObjectHandle;
use cubenativeutils::CubeError;
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::rc::Rc;

#[derive(Serialize, Deserialize, Debug)]
pub struct PreAggregationObjStatic {
#[serde(rename = "tableName")]
pub table_name: Option<String>,
#[serde(rename = "preAggregationName")]
pub pre_aggregation_name: Option<String>,
pub cube: Option<String>,
#[serde(rename = "preAggregationId")]
pub pre_aggregation_id: Option<String>,
}

Check warning on line 22 in rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/pre_aggregation_obj.rs

#[nativebridge::native_bridge(PreAggregationObjStatic)]
pub trait PreAggregationObj {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

Check warning on line 1 in rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs
use crate::planner::query_properties::OrderByItem;
use std::rc::Rc;
use crate::planner::query_properties::OrderByItem;

pub struct FullKeyAggregateQuery {
pub multistage_members: Vec<Rc<LogicalMultiStageMember>>,
Expand All @@ -11,10 +11,10 @@
pub ungrouped: bool,
pub order_by: Vec<OrderByItem>,
pub source: Rc<FullKeyAggregate>,
}

Check warning on line 14 in rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs

impl PrettyPrint for FullKeyAggregateQuery {
fn pretty_print(&self, result: &mut PrettyPrintResult, state: &PrettyPrintState) {
fn pretty_print(&self, result: &mut PrettyPrintResult, state: &PrettyPrintState) {
result.println("FullKeyAggregateQuery: ", state);
let state = state.new_level();
let details_state = state.new_level();
Expand All @@ -36,20 +36,13 @@
result.println(&format!("limit:{}", limit), &state);
}
result.println(&format!("ungrouped:{}", self.ungrouped), &state);
if !self.order_by.is_empty() {

Check warning on line 39 in rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs
result.println("order_by:", &state);
for order_by in self.order_by.iter() {
result.println(
&format!(
"{} {}",
order_by.name(),
if order_by.desc() { "desc" } else { "asc" }
),
&details_state,
);
result.println(&format!("{} {}", order_by.name(), if order_by.desc() { "desc" } else { "asc" }), &details_state);
}
}
result.println("source:", &state);
self.source.pretty_print(result, &details_state);

Check warning on line 46 in rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs

View workflow job for this annotation

GitHub Actions / Check fmt/clippy

Diff in /__w/cube/cube/rust/cubesqlplanner/cubesqlplanner/src/logical_plan/full_key_aggregate_query.rs
}
}
}
6 changes: 5 additions & 1 deletion rust/cubesqlplanner/cubesqlplanner/src/logical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ mod join;
mod keys_subquery;
mod measure_subquery;
mod multistage;
mod pretty_print;
pub mod pretty_print;
mod query;
mod regular_measures_query;
mod resolve_multiplied_measures;
mod schema;
mod simple_query;
mod pre_aggregation;
pub mod optimizers;

pub use aggregate_multiplied_subquery::*;
pub use cube::*;
Expand All @@ -31,3 +33,5 @@ pub use regular_measures_query::*;
pub use resolve_multiplied_measures::*;
pub use schema::*;
pub use simple_query::*;
pub use optimizers::*;
pub use pre_aggregation::*;
Loading
Loading