Skip to content

Commit 8776769

Browse files
authored
refactor(cubesql): Split QueryPlanner and QueryPlan (#8584)
1 parent 03b6084 commit 8776769

File tree

20 files changed

+1425
-1420
lines changed

20 files changed

+1425
-1420
lines changed

rust/cubesql/cubesql/benches/large_model.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use std::{env::set_var, sync::Arc, time::Duration};
33
use criterion::{criterion_group, criterion_main, Criterion};
44

55
use cubeclient::models::{V1CubeMeta, V1CubeMetaDimension, V1CubeMetaMeasure};
6-
use cubesql::compile::{
7-
test::{
6+
use cubesql::{
7+
compile::test::{
88
rewrite_engine::{cube_context, query_to_logical_plan, rewrite_rules, rewrite_runner},
99
sql_generator,
1010
},
11-
MetaContext,
11+
transport::MetaContext,
1212
};
1313
use egg::StopReason;
1414
use itertools::Itertools;

rust/cubesql/cubesql/src/compile/engine/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ use datafusion::{
1212
};
1313

1414
use crate::{
15-
compile::{DatabaseProtocolDetails, MetaContext},
15+
compile::DatabaseProtocolDetails,
1616
sql::{ColumnType, SessionManager, SessionState},
17-
transport::{CubeMeta, V1CubeMetaExt},
17+
transport::{CubeMeta, MetaContext, V1CubeMetaExt},
1818
CubeError,
1919
};
2020

rust/cubesql/cubesql/src/compile/engine/df/scan.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ use log::warn;
3131
use crate::{
3232
compile::{
3333
engine::df::wrapper::{CubeScanWrapperNode, SqlQuery},
34-
find_cube_scans_deep_search,
3534
rewrite::WrappedSelectType,
35+
test::find_cube_scans_deep_search,
3636
},
3737
config::ConfigObj,
3838
sql::AuthContextRef,
@@ -1326,11 +1326,9 @@ pub fn transform_response<V: ValueObject>(
13261326
mod tests {
13271327
use super::*;
13281328
use crate::{
1329-
compile::{
1330-
engine::df::wrapper::SqlQuery, DatabaseProtocol, DatabaseProtocolDetails, MetaContext,
1331-
},
1329+
compile::{engine::df::wrapper::SqlQuery, DatabaseProtocol, DatabaseProtocolDetails},
13321330
sql::HttpAuthContext,
1333-
transport::SqlResponse,
1331+
transport::{MetaContext, SqlResponse},
13341332
CubeError,
13351333
};
13361334
use cubeclient::models::V1LoadResponse;

rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_class.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{any::Any, sync::Arc};
33
use async_trait::async_trait;
44
use bigdecimal::ToPrimitive;
55

6+
use crate::transport::CubeMetaTable;
67
use datafusion::{
78
arrow::{
89
array::{Array, ArrayRef, BooleanBuilder, Int32Builder, StringBuilder, UInt32Builder},
@@ -15,8 +16,6 @@ use datafusion::{
1516
physical_plan::{memory::MemoryExec, ExecutionPlan},
1617
};
1718

18-
use crate::compile::CubeMetaTable;
19-
2019
struct PgClass {
2120
oid: u32,
2221
relname: String,

rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_stat_user_tables.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::{any::Any, sync::Arc};
22

33
use async_trait::async_trait;
44

5+
use crate::transport::CubeMetaTable;
56
use datafusion::{
67
arrow::{
78
array::{
@@ -16,8 +17,6 @@ use datafusion::{
1617
physical_plan::{memory::MemoryExec, ExecutionPlan},
1718
};
1819

19-
use crate::compile::CubeMetaTable;
20-
2120
struct PgCatalogStatUserTablesBuilder {
2221
relid: UInt32Builder,
2322
schemaname: StringBuilder,

rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_statio_user_tables.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::{any::Any, sync::Arc};
22

33
use async_trait::async_trait;
44

5+
use crate::transport::CubeMetaTable;
56
use datafusion::{
67
arrow::{
78
array::{Array, ArrayRef, Int64Builder, StringBuilder, UInt32Builder},
@@ -14,8 +15,6 @@ use datafusion::{
1415
physical_plan::{memory::MemoryExec, ExecutionPlan},
1516
};
1617

17-
use crate::compile::CubeMetaTable;
18-
1918
struct PgCatalogStatioUserTablesBuilder {
2019
relid: UInt32Builder,
2120
schemaname: StringBuilder,

rust/cubesql/cubesql/src/compile/engine/information_schema/redshift/svv_table_info.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{any::Any, sync::Arc};
22

3+
use crate::transport::CubeMetaTable;
34
use async_trait::async_trait;
45
use datafusion::{
56
arrow::{
@@ -16,8 +17,6 @@ use datafusion::{
1617
physical_plan::{memory::MemoryExec, ExecutionPlan},
1718
};
1819

19-
use crate::compile::CubeMetaTable;
20-
2120
struct RedshiftSvvTableInfoBuilder {
2221
databases: StringBuilder,
2322
schemas: StringBuilder,

0 commit comments

Comments
 (0)