From 3e203e804892b9bcadb0ff7c3aeb5dd984f1af43 Mon Sep 17 00:00:00 2001 From: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:00:12 +0400 Subject: [PATCH 01/11] chore(cubesql): Do not call async Node functions while planning (#8793) --- .../cubesql/src/compile/query_engine.rs | 74 ++++++++++++++-- .../cubesql/src/compile/rewrite/rewriter.rs | 17 ++-- rust/cubesql/cubesql/src/compile/router.rs | 48 +---------- .../cubesql/cubesql/src/sql/compiler_cache.rs | 85 ++++++++++--------- rust/cubesql/cubesql/src/sql/postgres/shim.rs | 34 ++++---- 5 files changed, 137 insertions(+), 121 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/query_engine.rs b/rust/cubesql/cubesql/src/compile/query_engine.rs index 2532fa12efc48..afc7f40cafb61 100644 --- a/rust/cubesql/cubesql/src/compile/query_engine.rs +++ b/rust/cubesql/cubesql/src/compile/query_engine.rs @@ -1,5 +1,8 @@ use crate::compile::engine::df::planner::CubeQueryPlanner; -use std::{backtrace::Backtrace, collections::HashMap, future::Future, pin::Pin, sync::Arc}; +use std::{ + backtrace::Backtrace, collections::HashMap, future::Future, pin::Pin, sync::Arc, + time::SystemTime, +}; use crate::{ compile::{ @@ -21,8 +24,9 @@ use crate::{ }, config::ConfigObj, sql::{ - compiler_cache::CompilerCache, statement::SensitiveDataSanitizer, SessionManager, - SessionState, + compiler_cache::{CompilerCache, CompilerCacheEntry}, + statement::SensitiveDataSanitizer, + SessionManager, SessionState, }, transport::{LoadRequestMeta, MetaContext, SpanId, TransportService}, CubeErrorCauseType, @@ -78,6 +82,11 @@ pub trait QueryEngine { fn sanitize_statement(&self, stmt: &Self::AstStatementType) -> Self::AstStatementType; + async fn get_cache_entry( + &self, + state: Arc, + ) -> Result, CompilationError>; + async fn plan( &self, stmt: Self::AstStatementType, @@ -86,6 +95,26 @@ pub trait QueryEngine { meta: Arc, state: Arc, ) -> CompilationResult<(QueryPlan, Self::PlanMetadataType)> { + let cache_entry = self.get_cache_entry(state.clone()).await?; + + let planning_start = SystemTime::now(); + if let Some(span_id) = span_id.as_ref() { + if let Some(auth_context) = state.auth_context() { + self.transport_ref() + .log_load_state( + Some(span_id.clone()), + auth_context, + state.get_load_request_meta(), + "SQL API Query Planning".to_string(), + serde_json::json!({ + "query": span_id.query_key.clone(), + }), + ) + .await + .map_err(|e| CompilationError::internal(e.to_string()))?; + } + } + let ctx = self.create_session_ctx(state.clone())?; let cube_ctx = self.create_cube_ctx(state.clone(), meta.clone(), ctx.clone())?; @@ -144,7 +173,7 @@ pub trait QueryEngine { let mut finalized_graph = self .compiler_cache_ref() .rewrite( - state.auth_context().unwrap(), + Arc::clone(&cache_entry), cube_ctx.clone(), converter.take_egraph(), &query_params.unwrap(), @@ -192,6 +221,7 @@ pub trait QueryEngine { let result = rewriter .find_best_plan( root, + cache_entry, state.auth_context().unwrap(), qtrace, span_id.clone(), @@ -243,12 +273,31 @@ pub trait QueryEngine { // TODO: We should find what optimizers will be safety to use for OLAP queries guard.optimizer.rules = vec![]; } - if let Some(span_id) = span_id { + if let Some(span_id) = &span_id { span_id.set_is_data_query(true).await; } }; log::debug!("Rewrite: {:#?}", rewrite_plan); + + if let Some(span_id) = span_id.as_ref() { + if let Some(auth_context) = state.auth_context() { + self.transport_ref() + .log_load_state( + Some(span_id.clone()), + auth_context, + state.get_load_request_meta(), + "SQL API Query Planning Success".to_string(), + serde_json::json!({ + "query": span_id.query_key.clone(), + "duration": planning_start.elapsed().unwrap().as_millis() as u64, + }), + ) + .await + .map_err(|e| CompilationError::internal(e.to_string()))?; + } + } + let rewrite_plan = Self::evaluate_wrapped_sql( self.transport_ref().clone(), Arc::new(state.get_load_request_meta()), @@ -501,6 +550,21 @@ impl QueryEngine for SqlQueryEngine { fn sanitize_statement(&self, stmt: &Self::AstStatementType) -> Self::AstStatementType { SensitiveDataSanitizer::new().replace(stmt.clone()) } + + async fn get_cache_entry( + &self, + state: Arc, + ) -> Result, CompilationError> { + self.compiler_cache_ref() + .get_cache_entry( + state.auth_context().ok_or_else(|| { + CompilationError::internal("Unable to get auth context".to_string()) + })?, + state.protocol.clone(), + ) + .await + .map_err(|e| CompilationError::internal(e.to_string())) + } } fn is_olap_query(parent: &LogicalPlan) -> Result { diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs index 70346db658e19..bb7840374fae4 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs @@ -15,7 +15,7 @@ use crate::{ CubeContext, }, config::ConfigObj, - sql::AuthContextRef, + sql::{compiler_cache::CompilerCacheEntry, AuthContextRef}, transport::{MetaContext, SpanId}, CubeError, }; @@ -310,7 +310,7 @@ impl Rewriter { pub async fn run_rewrite_to_completion( &mut self, - auth_context: AuthContextRef, + cache_entry: Arc, qtrace: &mut Option, ) -> Result { let cube_context = self.cube_context.clone(); @@ -323,11 +323,7 @@ impl Rewriter { .sessions .server .compiler_cache - .rewrite_rules( - auth_context.clone(), - cube_context.session_state.protocol.clone(), - false, - ) + .rewrite_rules(cache_entry, false) .await?; let (plan, qtrace_egraph_iterations) = tokio::task::spawn_blocking(move || { @@ -392,6 +388,7 @@ impl Rewriter { pub async fn find_best_plan( &mut self, root: Id, + cache_entry: Arc, auth_context: AuthContextRef, qtrace: &mut Option, span_id: Option>, @@ -407,11 +404,7 @@ impl Rewriter { .sessions .server .compiler_cache - .rewrite_rules( - auth_context.clone(), - cube_context.session_state.protocol.clone(), - true, - ) + .rewrite_rules(cache_entry, true) .await?; let (plan, qtrace_egraph_iterations, qtrace_best_graph) = diff --git a/rust/cubesql/cubesql/src/compile/router.rs b/rust/cubesql/cubesql/src/compile/router.rs index 41e9e5c5213d9..6d5bf3a8f1f77 100644 --- a/rust/cubesql/cubesql/src/compile/router.rs +++ b/rust/cubesql/cubesql/src/compile/router.rs @@ -3,7 +3,7 @@ use crate::compile::{ StatusFlags, }; use sqlparser::ast; -use std::{collections::HashMap, sync::Arc, time::SystemTime}; +use std::{collections::HashMap, sync::Arc}; use crate::{ compile::{ @@ -61,50 +61,8 @@ impl QueryRouter { qtrace: &mut Option, span_id: Option>, ) -> CompilationResult { - let planning_start = SystemTime::now(); - if let Some(span_id) = span_id.as_ref() { - if let Some(auth_context) = self.state.auth_context() { - self.session_manager - .server - .transport - .log_load_state( - Some(span_id.clone()), - auth_context, - self.state.get_load_request_meta(), - "SQL API Query Planning".to_string(), - serde_json::json!({ - "query": span_id.query_key.clone(), - }), - ) - .await - .map_err(|e| CompilationError::internal(e.to_string()))?; - } - } - let result = self - .create_df_logical_plan(stmt.clone(), qtrace, span_id.clone()) - .await?; - - if let Some(span_id) = span_id.as_ref() { - if let Some(auth_context) = self.state.auth_context() { - self.session_manager - .server - .transport - .log_load_state( - Some(span_id.clone()), - auth_context, - self.state.get_load_request_meta(), - "SQL API Query Planning Success".to_string(), - serde_json::json!({ - "query": span_id.query_key.clone(), - "duration": planning_start.elapsed().unwrap().as_millis() as u64, - }), - ) - .await - .map_err(|e| CompilationError::internal(e.to_string()))?; - } - } - - return Ok(result); + self.create_df_logical_plan(stmt.clone(), qtrace, span_id.clone()) + .await } pub async fn plan( diff --git a/rust/cubesql/cubesql/src/sql/compiler_cache.rs b/rust/cubesql/cubesql/src/sql/compiler_cache.rs index 80131a5192e9a..d162a95021182 100644 --- a/rust/cubesql/cubesql/src/sql/compiler_cache.rs +++ b/rust/cubesql/cubesql/src/sql/compiler_cache.rs @@ -21,20 +21,18 @@ use uuid::Uuid; pub trait CompilerCache: Send + Sync + Debug { async fn rewrite_rules( &self, - ctx: AuthContextRef, - protocol: DatabaseProtocol, + cache_entry: Arc, eval_stable_functions: bool, ) -> Result>, CubeError>; async fn meta( &self, - ctx: AuthContextRef, - protocol: DatabaseProtocol, + cache_entry: Arc, ) -> Result, CubeError>; async fn parameterized_rewrite( &self, - ctx: AuthContextRef, + cache_entry: Arc, cube_context: Arc, input_plan: CubeEGraph, qtrace: &mut Option, @@ -42,12 +40,18 @@ pub trait CompilerCache: Send + Sync + Debug { async fn rewrite( &self, - ctx: AuthContextRef, + cache_entry: Arc, cube_context: Arc, input_plan: CubeEGraph, param_values: &HashMap, qtrace: &mut Option, ) -> Result; + + async fn get_cache_entry( + &self, + ctx: AuthContextRef, + protocol: DatabaseProtocol, + ) -> Result, CubeError>; } #[derive(Debug)] @@ -70,12 +74,9 @@ crate::di_service!(CompilerCacheImpl, [CompilerCache]); impl CompilerCache for CompilerCacheImpl { async fn rewrite_rules( &self, - ctx: AuthContextRef, - protocol: DatabaseProtocol, + cache_entry: Arc, eval_stable_functions: bool, ) -> Result>, CubeError> { - let cache_entry = self.get_cache_entry(ctx.clone(), protocol).await?; - let rewrite_rules = { cache_entry .rewrite_rules @@ -105,33 +106,28 @@ impl CompilerCache for CompilerCacheImpl { async fn meta( &self, - ctx: AuthContextRef, - protocol: DatabaseProtocol, + cache_entry: Arc, ) -> Result, CubeError> { - let cache_entry = self.get_cache_entry(ctx.clone(), protocol).await?; Ok(cache_entry.meta_context.clone()) } async fn parameterized_rewrite( &self, - ctx: AuthContextRef, + cache_entry: Arc, cube_context: Arc, parameterized_graph: CubeEGraph, qtrace: &mut Option, ) -> Result { - let cache_entry = self - .get_cache_entry(ctx.clone(), cube_context.session_state.protocol.clone()) - .await?; - let graph_key = egraph_hash(¶meterized_graph, None); + let cache_entry_clone = Arc::clone(&cache_entry); let mut rewrites_cache_lock = cache_entry.parameterized_cache.lock().await; if let Some(rewrite_entry) = rewrites_cache_lock.get(&graph_key) { Ok(rewrite_entry.clone()) } else { let mut rewriter = Rewriter::new(parameterized_graph, cube_context); let rewrite_entry = rewriter - .run_rewrite_to_completion(ctx.clone(), qtrace) + .run_rewrite_to_completion(cache_entry_clone, qtrace) .await?; rewrites_cache_lock.put(graph_key, rewrite_entry.clone()); Ok(rewrite_entry) @@ -140,7 +136,7 @@ impl CompilerCache for CompilerCacheImpl { async fn rewrite( &self, - ctx: AuthContextRef, + cache_entry: Arc, cube_context: Arc, input_plan: CubeEGraph, param_values: &HashMap, @@ -149,46 +145,40 @@ impl CompilerCache for CompilerCacheImpl { if !self.config_obj.enable_rewrite_cache() { let mut rewriter = Rewriter::new(input_plan, cube_context); rewriter.add_param_values(param_values)?; - return Ok(rewriter.run_rewrite_to_completion(ctx, qtrace).await?); + return Ok(rewriter + .run_rewrite_to_completion(cache_entry, qtrace) + .await?); } - let cache_entry = self - .get_cache_entry(ctx.clone(), cube_context.session_state.protocol.clone()) - .await?; let graph_key = egraph_hash(&input_plan, Some(param_values)); + let cache_entry_clone = Arc::clone(&cache_entry); let mut rewrites_cache_lock = cache_entry.queries_cache.lock().await; if let Some(plan) = rewrites_cache_lock.get(&graph_key) { Ok(plan.clone()) } else { let graph = if self.config_obj.enable_parameterized_rewrite_cache() { - self.parameterized_rewrite(ctx.clone(), cube_context.clone(), input_plan, qtrace) - .await? + self.parameterized_rewrite( + Arc::clone(&cache_entry), + cube_context.clone(), + input_plan, + qtrace, + ) + .await? } else { input_plan }; let mut rewriter = Rewriter::new(graph, cube_context); rewriter.add_param_values(param_values)?; - let final_plan = rewriter.run_rewrite_to_completion(ctx, qtrace).await?; + let final_plan = rewriter + .run_rewrite_to_completion(cache_entry_clone, qtrace) + .await?; rewrites_cache_lock.put(graph_key, final_plan.clone()); Ok(final_plan) } } -} -impl CompilerCacheImpl { - pub fn new(config_obj: Arc, transport: Arc) -> Self { - let compiler_cache_size = config_obj.compiler_cache_size(); - CompilerCacheImpl { - config_obj, - transport, - compiler_id_to_entry: MutexAsync::new(LruCache::new( - NonZeroUsize::new(compiler_cache_size).unwrap(), - )), - } - } - - pub async fn get_cache_entry( + async fn get_cache_entry( &self, ctx: AuthContextRef, protocol: DatabaseProtocol, @@ -231,3 +221,16 @@ impl CompilerCacheImpl { Ok(cache_entry) } } + +impl CompilerCacheImpl { + pub fn new(config_obj: Arc, transport: Arc) -> Self { + let compiler_cache_size = config_obj.compiler_cache_size(); + CompilerCacheImpl { + config_obj, + transport, + compiler_id_to_entry: MutexAsync::new(LruCache::new( + NonZeroUsize::new(compiler_cache_size).unwrap(), + )), + } + } +} diff --git a/rust/cubesql/cubesql/src/sql/postgres/shim.rs b/rust/cubesql/cubesql/src/sql/postgres/shim.rs index 55275b88cbfbe..357fca54ca62e 100644 --- a/rust/cubesql/cubesql/src/sql/postgres/shim.rs +++ b/rust/cubesql/cubesql/src/sql/postgres/shim.rs @@ -12,6 +12,7 @@ use crate::{ CommandCompletion, CompilationError, DatabaseProtocol, QueryPlan, StatusFlags, }, sql::{ + compiler_cache::CompilerCacheEntry, df_type_to_pg_tid, extended::{Cursor, Portal, PortalBatch, PortalFrom}, statement::{PostgresStatementParamsFinder, StatementPlaceholderReplacer}, @@ -240,6 +241,15 @@ impl AsyncPostgresShim { return Ok(()); } + async fn get_cache_entry(&self) -> Result, CubeError> { + self.session + .session_manager + .server + .compiler_cache + .get_cache_entry(self.auth_context()?, self.session.state.protocol.clone()) + .await + } + pub async fn run_on( fast_shutdown_interruptor: CancellationToken, semifast_shutdown_interruptor: CancellationToken, @@ -1058,12 +1068,8 @@ impl AsyncPostgresShim { source_statement.bind(body.to_bind_values(¶meters)?)?; drop(statements_guard); - let meta = self - .session - .server - .compiler_cache - .meta(self.auth_context()?, self.session.state.protocol.clone()) - .await?; + let cache_entry = self.get_cache_entry().await?; + let meta = self.session.server.compiler_cache.meta(cache_entry).await?; let plan = convert_statement_to_cube_query( prepared_statement, @@ -1171,12 +1177,8 @@ impl AsyncPostgresShim { .map(|param| param.coltype.to_pg_tid()) .collect(); - let meta = self - .session - .server - .compiler_cache - .meta(self.auth_context()?, self.session.state.protocol.clone()) - .await?; + let cache_entry = self.get_cache_entry().await?; + let meta = self.session.server.compiler_cache.meta(cache_entry).await?; let stmt_replacer = StatementPlaceholderReplacer::new(); let hacked_query = stmt_replacer.replace(query.clone())?; @@ -1794,12 +1796,8 @@ impl AsyncPostgresShim { qtrace: &mut Option, span_id: Option>, ) -> Result<(), ConnectionError> { - let meta = self - .session - .server - .compiler_cache - .meta(self.auth_context()?, self.session.state.protocol.clone()) - .await?; + let cache_entry = self.get_cache_entry().await?; + let meta = self.session.server.compiler_cache.meta(cache_entry).await?; let statements = parse_sql_to_statements(&query.to_string(), DatabaseProtocol::PostgreSQL, qtrace)?; From 82ba01ae3695dc7469e76dd8bced1c532bea0865 Mon Sep 17 00:00:00 2001 From: Konstantin Burkalev Date: Wed, 4 Dec 2024 12:36:03 +0200 Subject: [PATCH 02/11] fix(schema-compiler): Fix ungrouped cumulative queries incorrect sql generation (#8981) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(schema-compiler): Fix ungrouped cumulative queries incorrect sql generation * add tests * Revert "fix(schema-compiler): Fix ungrouped cumulative queries incorrect sql generation" This reverts commit ca365fa540cd3b6d5e99f07883d14bf31de1ce97. * fix(schema-compiler): Fix ungrouped cumulative queries incorrect sql generation * fix tests: have to add alias, because of too long identifiers --- .../src/adapter/BaseQuery.js | 4 + .../postgres/sql-generation.test.ts | 148 ++++++++++++------ 2 files changed, 108 insertions(+), 44 deletions(-) diff --git a/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js b/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js index 3ac1a2de9e600..651e772b5f139 100644 --- a/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js +++ b/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js @@ -2539,6 +2539,10 @@ export class BaseQuery { return evaluateSql === '*' ? '1' : evaluateSql; } if (this.ungrouped) { + if ((this.safeEvaluateSymbolContext().ungroupedAliasesForCumulative || {})[measurePath]) { + evaluateSql = this.safeEvaluateSymbolContext().ungroupedAliasesForCumulative[measurePath]; + } + if (symbol.type === 'count' || symbol.type === 'countDistinct' || symbol.type === 'countDistinctApprox') { const sql = this.caseWhenStatement([{ sql: `(${evaluateSql}) IS NOT NULL`, label: '1' }]); return evaluateSql === '*' ? '1' : sql; diff --git a/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts b/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts index f9493faba34a0..5a9026d3ad55b 100644 --- a/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts +++ b/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts @@ -296,6 +296,7 @@ describe('SQL Generation', () => { \${FILTER_PARAMS.visitor_checkins.created_at.filter('created_at')} AND \${FILTER_GROUP(FILTER_PARAMS.visitor_checkins.created_at.filter("(created_at - INTERVAL '3 DAY')"), FILTER_PARAMS.visitor_checkins.source.filter('source'))} \`, + sql_alias: \`vc\`, rewriteQueries: true, @@ -568,28 +569,28 @@ describe('SQL Generation', () => { visitors__created_at_day: '2017-01-02T00:00:00.000Z', visitors__visitor_revenue: '100', visitors__visitor_count: '1', - visitor_checkins__visitor_checkins_count: '3', + vc__visitor_checkins_count: '3', visitors__per_visitor_revenue: '100' }, { visitors__created_at_day: '2017-01-04T00:00:00.000Z', visitors__visitor_revenue: '200', visitors__visitor_count: '1', - visitor_checkins__visitor_checkins_count: '2', + vc__visitor_checkins_count: '2', visitors__per_visitor_revenue: '200' }, { visitors__created_at_day: '2017-01-05T00:00:00.000Z', visitors__visitor_revenue: null, visitors__visitor_count: '1', - visitor_checkins__visitor_checkins_count: '1', + vc__visitor_checkins_count: '1', visitors__per_visitor_revenue: null }, { visitors__created_at_day: '2017-01-06T00:00:00.000Z', visitors__visitor_revenue: null, visitors__visitor_count: '2', - visitor_checkins__visitor_checkins_count: '0', + vc__visitor_checkins_count: '0', visitors__per_visitor_revenue: null } ] @@ -627,7 +628,7 @@ describe('SQL Generation', () => { }, [{ visitors__visitor_revenue: '300', visitors__visitor_count: '5', - visitor_checkins__visitor_checkins_count: '6', + vc__visitor_checkins_count: '6', visitors__per_visitor_revenue: '60' }])); @@ -748,22 +749,22 @@ describe('SQL Generation', () => { { visitors__created_at_day: '2017-01-02T00:00:00.000Z', visitors__revenue_rolling: null, - visitor_checkins__visitor_checkins_count: '3' + vc__visitor_checkins_count: '3' }, { visitors__created_at_day: '2017-01-04T00:00:00.000Z', visitors__revenue_rolling: '100', - visitor_checkins__visitor_checkins_count: '2' + vc__visitor_checkins_count: '2' }, { visitors__created_at_day: '2017-01-05T00:00:00.000Z', visitors__revenue_rolling: '200', - visitor_checkins__visitor_checkins_count: '1' + vc__visitor_checkins_count: '1' }, { visitors__created_at_day: '2017-01-06T00:00:00.000Z', visitors__revenue_rolling: '500', - visitor_checkins__visitor_checkins_count: '0' + vc__visitor_checkins_count: '0' } ])); @@ -979,7 +980,7 @@ describe('SQL Generation', () => { return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { console.log(JSON.stringify(res)); expect(res).toEqual( - [{ visitor_checkins__revenue_per_checkin: '50' }] + [{ vc__revenue_per_checkin: '50' }] ); }); }); @@ -1000,7 +1001,7 @@ describe('SQL Generation', () => { return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { console.log(JSON.stringify(res)); expect(res).toEqual( - [{ visitor_checkins__google_sourced_checkins: '1' }] + [{ vc__google_sourced_checkins: '1' }] ); }); }); @@ -1024,7 +1025,7 @@ describe('SQL Generation', () => { return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { console.log(JSON.stringify(res)); expect(res).toEqual( - [{ visitor_checkins__google_sourced_checkins: '1' }] + [{ vc__google_sourced_checkins: '1' }] ); }); }); @@ -1435,19 +1436,78 @@ describe('SQL Generation', () => { }] }, [ { - visitor_checkins__cards_count: '0', + vc__cards_count: '0', visitors__visitor_revenue: '300' }, { - visitor_checkins__cards_count: '1', + vc__cards_count: '1', visitors__visitor_revenue: '100' }, { - visitor_checkins__cards_count: null, + vc__cards_count: null, visitors__visitor_revenue: null } ])); + it('ungrouped cumulative query', async () => { + await compiler.compile(); + + const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, { + measures: [ + 'visitor_checkins.visitor_checkins_count', + 'visitor_checkins.visitorCheckinsRolling', + ], + dimensions: [ + 'visitor_checkins.id' + ], + timeDimensions: [{ + dimension: 'visitor_checkins.created_at', + granularity: 'day', + dateRange: ['2017-01-01', '2017-01-30'] + }], + timezone: 'America/Los_Angeles', + filters: [], + order: [{ + id: 'visitor_checkins.id' + }], + ungrouped: true + }); + + console.log(query.buildSqlAndParams()); + + return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { + console.log(JSON.stringify(res)); + expect(res).toEqual( + [ + { + vc__id: 3, + vc__created_at_day: '2017-01-04T00:00:00.000Z', + vc__visitor_checkins_count: 1, + vc__visitor_checkins_rolling: 1 + }, + { + vc__id: 4, + vc__created_at_day: '2017-01-04T00:00:00.000Z', + vc__visitor_checkins_count: 1, + vc__visitor_checkins_rolling: 1 + }, + { + vc__id: 5, + vc__created_at_day: '2017-01-04T00:00:00.000Z', + vc__visitor_checkins_count: 1, + vc__visitor_checkins_rolling: 1 + }, + { + vc__id: 6, + vc__created_at_day: '2017-01-05T00:00:00.000Z', + vc__visitor_checkins_count: 1, + vc__visitor_checkins_rolling: 1 + } + ] + ); + }); + }); + it('join rollup pre-aggregation', async () => { await compiler.compile(); @@ -1490,7 +1550,7 @@ describe('SQL Generation', () => { expect(res).toEqual( [ { - visitor_checkins__source: 'google', + vc__source: 'google', visitors__created_at_day: '2017-01-02T00:00:00.000Z', visitors__per_visitor_revenue: '100' } @@ -1537,7 +1597,7 @@ describe('SQL Generation', () => { console.log(JSON.stringify(res)); expect(res).toEqual( [{ - visitor_checkins__source: 'google', + vc__source: 'google', visitors__created_at_day: '2017-01-02T00:00:00.000Z', visitors__visitor_revenue: '100' }] @@ -1564,7 +1624,7 @@ describe('SQL Generation', () => { return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { console.log(JSON.stringify(res)); expect(res).toEqual( - [{ visitor_checkins__revenue_per_checkin: '60' }] + [{ vc__revenue_per_checkin: '60' }] ); }); }); @@ -1590,7 +1650,7 @@ describe('SQL Generation', () => { return dbRunner.testQuery(query.buildSqlAndParams()).then(res => { console.log(JSON.stringify(res)); expect(res).toEqual( - [{ visitor_checkins__revenue_per_checkin: '50' }] + [{ vc__revenue_per_checkin: '50' }] ); }); }); @@ -1635,12 +1695,12 @@ describe('SQL Generation', () => { ungrouped: true, allowUngroupedWithoutPrimaryKey: true, }, [ - { visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__google_sourced_checkins: 1 }, + { vc__created_at_day: '2017-01-02T00:00:00.000Z', vc__google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-03T00:00:00.000Z', vc__google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-05T00:00:00.000Z', vc__google_sourced_checkins: 1 }, ])); it('ungrouped filtered distinct count', () => runQueryTest({ @@ -1659,12 +1719,12 @@ describe('SQL Generation', () => { ungrouped: true, allowUngroupedWithoutPrimaryKey: true, }, [ - { visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null }, - { visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: 1 }, + { vc__created_at_day: '2017-01-02T00:00:00.000Z', vc__unique_google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-03T00:00:00.000Z', vc__unique_google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_google_sourced_checkins: null }, + { vc__created_at_day: '2017-01-05T00:00:00.000Z', vc__unique_google_sourced_checkins: 1 }, ])); it('ungrouped ratio measure', () => runQueryTest({ @@ -1683,12 +1743,12 @@ describe('SQL Generation', () => { ungrouped: true, allowUngroupedWithoutPrimaryKey: true, }, [ - { visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, - { visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, - { visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, - { visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-02T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-03T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-04T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, + { vc__created_at_day: '2017-01-05T00:00:00.000Z', vc__unique_sources_per_checking: 1 }, ])); it('builds geo dimension', () => runQueryTest({ @@ -2116,7 +2176,7 @@ describe('SQL Generation', () => { }], order: [] }, [ - { visitor_checkins__visitor_checkins_count: '4' } + { vc__visitor_checkins_count: '4' } ]) ); @@ -2150,7 +2210,7 @@ describe('SQL Generation', () => { }], order: [] }, [ - { visitor_checkins__visitor_checkins_count: '4' } + { vc__visitor_checkins_count: '4' } ]) ); @@ -2168,7 +2228,7 @@ describe('SQL Generation', () => { }], order: [] }, [ - { visitor_checkins__visitor_checkins_count: '4' } + { vc__visitor_checkins_count: '4' } ]) ); @@ -2204,7 +2264,7 @@ describe('SQL Generation', () => { }], order: [] }, [ - { visitor_checkins__visitor_checkins_count: '1' } + { vc__visitor_checkins_count: '1' } ]) ); @@ -2244,7 +2304,7 @@ describe('SQL Generation', () => { }], order: [] }, [ - { visitor_checkins__visitor_checkins_count: '1' } + { vc__visitor_checkins_count: '1' } ]) ); @@ -2711,11 +2771,11 @@ describe('SQL Generation', () => { [{ visitors__percentage_of_total: 9, visitors__revenue: '100', - visitor_checkins__source: 'google' + vc__source: 'google' }, { visitors__percentage_of_total: 91, visitors__revenue: '1000', - visitor_checkins__source: null + vc__source: null }] )); From 8f45afa28d568ad48b52b44a167f945b61a6e5eb Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Thu, 5 Dec 2024 13:07:40 +0200 Subject: [PATCH 03/11] feat(firebolt): Automatically start the engine after connection (#9001) * automatically start the engine after connection * add tests * fix linter * start engine in the end of the test --- .../src/FireboltDriver.ts | 6 ++- .../test/autostart.test.ts | 37 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/packages/cubejs-firebolt-driver/src/FireboltDriver.ts b/packages/cubejs-firebolt-driver/src/FireboltDriver.ts index 57f22961ca70e..10ce708a2d5d8 100644 --- a/packages/cubejs-firebolt-driver/src/FireboltDriver.ts +++ b/packages/cubejs-firebolt-driver/src/FireboltDriver.ts @@ -77,7 +77,8 @@ export class FireboltDriver extends BaseDriver implements DriverInterface { testConnectionTimeout?: number, } = {}, ) { - super(config); + // Set connection timeout to 2 minutes to allow the engine to start if it's stopped + super({ testConnectionTimeout: 120000, ...config }); const dataSource = config.dataSource || @@ -122,6 +123,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface { private async initConnection() { try { const connection = await this.firebolt.connect(this.config.connection); + await this.ensureEngineRunning(); return connection; } catch (e) { this.connection = null; @@ -174,7 +176,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface { await connection.testConnection(); } catch (error) { console.log(error); - throw new Error('Unable to connect'); + throw error; } } diff --git a/packages/cubejs-firebolt-driver/test/autostart.test.ts b/packages/cubejs-firebolt-driver/test/autostart.test.ts index ede7fea5c85e8..3fbd52e534ef2 100644 --- a/packages/cubejs-firebolt-driver/test/autostart.test.ts +++ b/packages/cubejs-firebolt-driver/test/autostart.test.ts @@ -1,6 +1,9 @@ +import {assertDataSource, getEnv} from '@cubejs-backend/shared'; import { DriverTests } from '@cubejs-backend/testing-shared'; import { FireboltDriver } from '../src'; +import { Firebolt } from 'firebolt-sdk'; +import { version } from 'firebolt-sdk/package.json'; describe('FireboltDriver autostart', () => { let tests: DriverTests; @@ -30,4 +33,38 @@ describe('FireboltDriver autostart', () => { expect(driver.ensureEngineRunning).toHaveBeenCalled(); } }); + test('starts the engine after connection', async () => { + const dataSource = assertDataSource('default'); + + const username = getEnv('dbUser', { dataSource }); + const auth = username.includes('@') + ? { username, password: getEnv('dbPass', { dataSource }) } + : { client_id: username, client_secret: getEnv('dbPass', { dataSource }) }; + const engineName = getEnv('fireboltEngineName', { dataSource }); + const firebolt = Firebolt({ + apiEndpoint: getEnv('fireboltApiEndpoint', { dataSource }) || 'api.app.firebolt.io', + }) + await firebolt.connect({ + auth, + database: getEnv('dbName', { dataSource }), + account: getEnv('fireboltAccount', { dataSource }), + engineEndpoint: getEnv('fireboltEngineEndpoint', { dataSource }), + additionalParameters: { + userClients: [{ + name: 'CubeDev+Cube', + version + }] + }, + }); + + const engine = await firebolt.resourceManager.engine.getByName(engineName); + try { + await engine.stop(); + + driver = new FireboltDriver({}); + await driver.testConnection(); + } finally { + await engine.start(); + } + }); }); From 6d82f18c59f92cae2bb94fe754aa3c0431c24949 Mon Sep 17 00:00:00 2001 From: Sumeet Gajjar Date: Thu, 5 Dec 2024 09:32:21 -0800 Subject: [PATCH 04/11] fix(schema-compiler): fix FILTER_PARAMS to populate set and notSet filters in cube's SQL query (#8937) * fix(schema-compiler): fix FILTER_PARAMS to populate set and notSet filters in cube's SQL query * Fix {DATE_OPERATORS}Where methods to return '1 = 1' when the required parameters are unavailable * fix(ksql-driver): Kafka, list of brokers (#9009) * docs: A few notes * chore(cubesql): Do not call async Node functions while planning (#8793) * Add postgress integration tests --------- Co-authored-by: Konstantin Burkalev Co-authored-by: Dmitriy Rusov Co-authored-by: Igor Lukanin Co-authored-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com> --- .../src/adapter/BaseFilter.ts | 23 +++ .../src/adapter/BaseQuery.js | 29 ++- .../postgres/sql-generation.test.ts | 177 +++++++++++++++++- .../test/unit/base-query.test.ts | 78 ++++++++ 4 files changed, 291 insertions(+), 16 deletions(-) diff --git a/packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts b/packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts index f9f8f0271b1ff..b3be30233403e 100644 --- a/packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts +++ b/packages/cubejs-schema-compiler/src/adapter/BaseFilter.ts @@ -12,6 +12,8 @@ const dateTimeLocalURegex = /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\d\d\d\d$/; const dateRegex = /^\d\d\d\d-\d\d-\d\d$/; export class BaseFilter extends BaseDimension { + public static readonly ALWAYS_TRUE: string = '1 = 1'; + public readonly measure: any; public readonly operator: any; @@ -323,36 +325,57 @@ export class BaseFilter extends BaseDimension { public inDateRangeWhere(column) { const [from, to] = this.allocateTimestampParams(); + if (!from || !to) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.timeRangeFilter(column, from, to); } public notInDateRangeWhere(column) { const [from, to] = this.allocateTimestampParams(); + if (!from || !to) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.timeNotInRangeFilter(column, from, to); } public onTheDateWhere(column) { const [from, to] = this.allocateTimestampParams(); + if (!from || !to) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.timeRangeFilter(column, from, to); } public beforeDateWhere(column) { const [before] = this.allocateTimestampParams(); + if (!before) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.beforeDateFilter(column, before); } public beforeOrOnDateWhere(column) { const [before] = this.allocateTimestampParams(); + if (!before) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.beforeOrOnDateFilter(column, before); } public afterDateWhere(column) { const [after] = this.allocateTimestampParams(); + if (!after) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.afterDateFilter(column, after); } public afterOrOnDateWhere(column) { const [after] = this.allocateTimestampParams(); + if (!after) { + return BaseFilter.ALWAYS_TRUE; + } return this.query.afterOrOnDateFilter(column, after); } diff --git a/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js b/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js index 651e772b5f139..9cb9323a0b885 100644 --- a/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js +++ b/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js @@ -3805,7 +3805,7 @@ export class BaseQuery { static renderFilterParams(filter, filterParamArgs, allocateParam, newGroupFilter, aliases) { if (!filter) { - return '1 = 1'; + return BaseFilter.ALWAYS_TRUE; } if (filter.operator === 'and' || filter.operator === 'or') { @@ -3830,21 +3830,20 @@ export class BaseQuery { if (!filterParamArg) { throw new Error(`FILTER_PARAMS arg not found for ${filter.measure || filter.dimension}`); } - if ( - filterParams && filterParams.length - ) { - if (typeof filterParamArg.__column() === 'function') { - // eslint-disable-next-line prefer-spread - return filterParamArg.__column().apply( - null, - filterParams.map(allocateParam), - ); - } else { - return filter.conditionSql(filterParamArg.__column()); - } - } else { - return '1 = 1'; + + if (typeof filterParamArg.__column() !== 'function') { + return filter.conditionSql(filterParamArg.__column()); + } + + if (!filterParams || !filterParams.length) { + return BaseFilter.ALWAYS_TRUE; } + + // eslint-disable-next-line prefer-spread + return filterParamArg.__column().apply( + null, + filterParams.map(allocateParam), + ); } filterGroupFunction() { diff --git a/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts b/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts index 5a9026d3ad55b..06f676a655b14 100644 --- a/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts +++ b/packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts @@ -407,7 +407,7 @@ describe('SQL Generation', () => { cube('visitor_checkins_sources', { sql: \` - select id, source from visitor_checkins WHERE \${FILTER_PARAMS.visitor_checkins_sources.source.filter('source')} + select id, visitor_id, source from visitor_checkins WHERE \${FILTER_PARAMS.visitor_checkins_sources.source.filter('source')} \`, rewriteQueries: true, @@ -419,12 +419,22 @@ describe('SQL Generation', () => { } }, + measures: { + count: { + type: 'count' + } + }, + dimensions: { id: { type: 'number', sql: 'id', primaryKey: true }, + visitor_id: { + type: 'number', + sql: 'visitor_id' + }, source: { type: 'string', sql: 'source' @@ -1897,6 +1907,171 @@ describe('SQL Generation', () => { ]) ); + it( + 'equals NULL filter', + () => runQueryTest({ + measures: [ + 'visitor_checkins_sources.count' + ], + dimensions: [ + 'visitor_checkins_sources.visitor_id' + ], + timeDimensions: [], + timezone: 'America/Los_Angeles', + filters: [{ + dimension: 'visitor_checkins_sources.source', + operator: 'equals', + values: [null] + }], + order: [{ + id: 'visitor_checkins_sources.visitor_id' + }] + }, [ + { + visitor_checkins_sources__visitor_id: 1, + visitor_checkins_sources__count: '2' + }, + { + visitor_checkins_sources__visitor_id: 2, + visitor_checkins_sources__count: '2' + }, + { + visitor_checkins_sources__visitor_id: 3, + visitor_checkins_sources__count: '1' + } + ]) + ); + + it( + 'notSet(IS NULL) filter', + () => runQueryTest({ + measures: [ + 'visitor_checkins_sources.count' + ], + dimensions: [ + 'visitor_checkins_sources.visitor_id' + ], + timeDimensions: [], + timezone: 'America/Los_Angeles', + filters: [{ + dimension: 'visitor_checkins_sources.source', + operator: 'notSet', + }], + order: [{ + id: 'visitor_checkins_sources.visitor_id' + }] + }, [ + { + visitor_checkins_sources__visitor_id: 1, + visitor_checkins_sources__count: '2' + }, + { + visitor_checkins_sources__visitor_id: 2, + visitor_checkins_sources__count: '2' + }, + { + visitor_checkins_sources__visitor_id: 3, + visitor_checkins_sources__count: '1' + } + ]) + ); + + it( + 'notEquals NULL filter', + () => runQueryTest({ + measures: [ + 'visitor_checkins_sources.count' + ], + dimensions: [ + 'visitor_checkins_sources.visitor_id' + ], + timeDimensions: [], + timezone: 'America/Los_Angeles', + filters: [{ + dimension: 'visitor_checkins_sources.source', + operator: 'notEquals', + values: [null] + }], + order: [{ + id: 'visitor_checkins_sources.visitor_id' + }] + }, [ + { + visitor_checkins_sources__visitor_id: 1, + visitor_checkins_sources__count: '1' + } + ]) + ); + + it( + 'set(IS NOT NULL) filter', + () => runQueryTest({ + measures: [ + 'visitor_checkins_sources.count' + ], + dimensions: [ + 'visitor_checkins_sources.visitor_id' + ], + timeDimensions: [], + timezone: 'America/Los_Angeles', + filters: [{ + dimension: 'visitor_checkins_sources.source', + operator: 'set', + }], + order: [{ + id: 'visitor_checkins_sources.visitor_id' + }] + }, [ + { + visitor_checkins_sources__visitor_id: 1, + visitor_checkins_sources__count: '1' + } + ]) + ); + + it( + 'source is notSet(IS NULL) "or" source is google filter', + () => runQueryTest({ + measures: [ + 'visitor_checkins_sources.count' + ], + dimensions: [ + 'visitor_checkins_sources.visitor_id' + ], + timeDimensions: [], + timezone: 'America/Los_Angeles', + filters: [{ + or: [ + { + dimension: 'visitor_checkins_sources.source', + operator: 'notSet', + }, + { + dimension: 'visitor_checkins_sources.source', + operator: 'equals', + values: ['google'] + } + ] + }], + order: [{ + id: 'visitor_checkins_sources.visitor_id' + }] + }, [ + { + visitor_checkins_sources__visitor_id: 1, + visitor_checkins_sources__count: '3' + }, + { + visitor_checkins_sources__visitor_id: 2, + visitor_checkins_sources__count: '2' + }, + { + visitor_checkins_sources__visitor_id: 3, + visitor_checkins_sources__count: '1' + } + ]) + ); + it('year granularity', () => runQueryTest({ measures: [ 'visitors.visitor_count' diff --git a/packages/cubejs-schema-compiler/test/unit/base-query.test.ts b/packages/cubejs-schema-compiler/test/unit/base-query.test.ts index 3159fab098c41..b25e0c4fd7a45 100644 --- a/packages/cubejs-schema-compiler/test/unit/base-query.test.ts +++ b/packages/cubejs-schema-compiler/test/unit/base-query.test.ts @@ -1784,6 +1784,84 @@ describe('SQL Generation', () => { expect(cubeSQL).toMatch(/\(\s*\(.*type\s*=\s*\$\d\$.*OR.*type\s*=\s*\$\d\$.*\)\s*AND\s*\(.*type\s*=\s*\$\d\$.*OR.*type\s*=\s*\$\d\$.*\)\s*\)/); }); + it('equals NULL filter', async () => { + await compilers.compiler.compile(); + const query = new BaseQuery(compilers, { + measures: ['Order.count'], + filters: [ + { + and: [ + { + member: 'Order.type', + operator: 'equals', + values: [null], + }, + ] + } + ], + }); + const cubeSQL = query.cubeSql('Order'); + expect(cubeSQL).toContain('where (((type IS NULL)))'); + }); + + it('notSet(IS NULL) filter', async () => { + await compilers.compiler.compile(); + const query = new BaseQuery(compilers, { + measures: ['Order.count'], + filters: [ + { + and: [ + { + member: 'Order.type', + operator: 'notSet', + }, + ] + } + ], + }); + const cubeSQL = query.cubeSql('Order'); + expect(cubeSQL).toContain('where (((type IS NULL)))'); + }); + + it('notEquals NULL filter', async () => { + await compilers.compiler.compile(); + const query = new BaseQuery(compilers, { + measures: ['Order.count'], + filters: [ + { + and: [ + { + member: 'Order.type', + operator: 'notEquals', + values: [null], + }, + ] + } + ], + }); + const cubeSQL = query.cubeSql('Order'); + expect(cubeSQL).toContain('where (((type IS NOT NULL)))'); + }); + + it('set(IS NOT NULL) filter', async () => { + await compilers.compiler.compile(); + const query = new BaseQuery(compilers, { + measures: ['Order.count'], + filters: [ + { + and: [ + { + member: 'Order.type', + operator: 'set', + }, + ] + } + ], + }); + const cubeSQL = query.cubeSql('Order'); + expect(cubeSQL).toContain('where (((type IS NOT NULL)))'); + }); + it('propagate filter params from view into cube\'s query', async () => { await compilers.compiler.compile(); const query = new BaseQuery(compilers, { From 4e366d3375cbc8f2d8fc731a644b2310a41edfc0 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 5 Dec 2024 09:33:16 -0800 Subject: [PATCH 05/11] fix(server-core): fix improper requestId retrieval in DAP (#9017) --- packages/cubejs-server-core/src/core/CompilerApi.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/cubejs-server-core/src/core/CompilerApi.js b/packages/cubejs-server-core/src/core/CompilerApi.js index 65f8c31a9130b..96f7a99cb6d71 100644 --- a/packages/cubejs-server-core/src/core/CompilerApi.js +++ b/packages/cubejs-server-core/src/core/CompilerApi.js @@ -210,8 +210,8 @@ export class CompilerApi { return true; } - async getCubesFromQuery(query) { - const sql = await this.getSql(query, { requestId: query.requestId }); + async getCubesFromQuery(query, context) { + const sql = await this.getSql(query, { requestId: context.requestId }); return new Set(sql.memberNames.map(memberName => memberName.split('.')[0])); } @@ -243,7 +243,6 @@ export class CompilerApi { const result = { }; if (filter.memberReference) { - // TODO(maxim): will it work with different data types? const evaluatedValues = cubeEvaluator.evaluateContextFunction( cube, filter.values, @@ -273,14 +272,14 @@ export class CompilerApi { * - combining cube and view filters with AND */ async applyRowLevelSecurity(query, context) { - const compilers = await this.getCompilers({ requestId: query.requestId }); + const compilers = await this.getCompilers({ requestId: context.requestId }); const { cubeEvaluator } = compilers; if (!cubeEvaluator.isRbacEnabled()) { return query; } - const queryCubes = await this.getCubesFromQuery(query); + const queryCubes = await this.getCubesFromQuery(query, context); // We collect Cube and View filters separately because they have to be // applied in "two layers": first Cube filters, then View filters on top From 2b4bc9efeee2dc43515822738f23c6c5e85e4461 Mon Sep 17 00:00:00 2001 From: Maxim Leonovich Date: Thu, 5 Dec 2024 09:36:37 -0800 Subject: [PATCH 06/11] v1.1.8 --- CHANGELOG.md | 42 ++++++++++++++ lerna.json | 2 +- packages/cubejs-api-gateway/CHANGELOG.md | 11 ++++ packages/cubejs-api-gateway/package.json | 6 +- packages/cubejs-athena-driver/CHANGELOG.md | 8 +++ packages/cubejs-athena-driver/package.json | 8 +-- packages/cubejs-backend-cloud/CHANGELOG.md | 8 +++ packages/cubejs-backend-cloud/package.json | 4 +- packages/cubejs-backend-maven/CHANGELOG.md | 8 +++ packages/cubejs-backend-maven/package.json | 4 +- packages/cubejs-backend-native/CHANGELOG.md | 8 +++ packages/cubejs-backend-native/package.json | 6 +- packages/cubejs-backend-shared/CHANGELOG.md | 11 ++++ packages/cubejs-backend-shared/package.json | 2 +- packages/cubejs-base-driver/CHANGELOG.md | 8 +++ packages/cubejs-base-driver/package.json | 4 +- packages/cubejs-bigquery-driver/CHANGELOG.md | 8 +++ packages/cubejs-bigquery-driver/package.json | 8 +-- packages/cubejs-cli/CHANGELOG.md | 8 +++ packages/cubejs-cli/package.json | 8 +-- .../cubejs-clickhouse-driver/CHANGELOG.md | 12 ++++ .../cubejs-clickhouse-driver/package.json | 8 +-- packages/cubejs-crate-driver/CHANGELOG.md | 8 +++ packages/cubejs-crate-driver/package.json | 8 +-- packages/cubejs-cubestore-driver/CHANGELOG.md | 8 +++ packages/cubejs-cubestore-driver/package.json | 8 +-- .../CHANGELOG.md | 16 +++++ .../package.json | 10 ++-- .../cubejs-dbt-schema-extension/CHANGELOG.md | 8 +++ .../cubejs-dbt-schema-extension/package.json | 6 +- packages/cubejs-docker/CHANGELOG.md | 8 +++ packages/cubejs-docker/package.json | 58 +++++++++---------- packages/cubejs-dremio-driver/CHANGELOG.md | 8 +++ packages/cubejs-dremio-driver/package.json | 8 +-- packages/cubejs-druid-driver/CHANGELOG.md | 8 +++ packages/cubejs-druid-driver/package.json | 8 +-- packages/cubejs-duckdb-driver/CHANGELOG.md | 16 +++++ packages/cubejs-duckdb-driver/package.json | 10 ++-- .../cubejs-elasticsearch-driver/CHANGELOG.md | 8 +++ .../cubejs-elasticsearch-driver/package.json | 6 +- packages/cubejs-firebolt-driver/CHANGELOG.md | 11 ++++ packages/cubejs-firebolt-driver/package.json | 10 ++-- packages/cubejs-hive-driver/CHANGELOG.md | 8 +++ packages/cubejs-hive-driver/package.json | 6 +- packages/cubejs-jdbc-driver/CHANGELOG.md | 8 +++ packages/cubejs-jdbc-driver/package.json | 6 +- packages/cubejs-ksql-driver/CHANGELOG.md | 11 ++++ packages/cubejs-ksql-driver/package.json | 8 +-- .../cubejs-materialize-driver/CHANGELOG.md | 8 +++ .../cubejs-materialize-driver/package.json | 10 ++-- packages/cubejs-mongobi-driver/CHANGELOG.md | 8 +++ packages/cubejs-mongobi-driver/package.json | 6 +- packages/cubejs-mssql-driver/CHANGELOG.md | 8 +++ packages/cubejs-mssql-driver/package.json | 4 +- .../CHANGELOG.md | 8 +++ .../package.json | 6 +- packages/cubejs-mysql-driver/CHANGELOG.md | 8 +++ packages/cubejs-mysql-driver/package.json | 8 +-- packages/cubejs-oracle-driver/CHANGELOG.md | 8 +++ packages/cubejs-oracle-driver/package.json | 4 +- packages/cubejs-pinot-driver/CHANGELOG.md | 11 ++++ packages/cubejs-pinot-driver/package.json | 8 +-- packages/cubejs-postgres-driver/CHANGELOG.md | 8 +++ packages/cubejs-postgres-driver/package.json | 8 +-- packages/cubejs-prestodb-driver/CHANGELOG.md | 8 +++ packages/cubejs-prestodb-driver/package.json | 6 +- .../cubejs-query-orchestrator/CHANGELOG.md | 8 +++ .../cubejs-query-orchestrator/package.json | 8 +-- packages/cubejs-questdb-driver/CHANGELOG.md | 8 +++ packages/cubejs-questdb-driver/package.json | 10 ++-- packages/cubejs-redshift-driver/CHANGELOG.md | 8 +++ packages/cubejs-redshift-driver/package.json | 8 +-- packages/cubejs-schema-compiler/CHANGELOG.md | 20 +++++++ packages/cubejs-schema-compiler/package.json | 8 +-- packages/cubejs-server-core/CHANGELOG.md | 14 +++++ packages/cubejs-server-core/package.json | 18 +++--- packages/cubejs-server/CHANGELOG.md | 8 +++ packages/cubejs-server/package.json | 12 ++-- packages/cubejs-snowflake-driver/CHANGELOG.md | 8 +++ packages/cubejs-snowflake-driver/package.json | 6 +- packages/cubejs-sqlite-driver/CHANGELOG.md | 8 +++ packages/cubejs-sqlite-driver/package.json | 6 +- packages/cubejs-templates/CHANGELOG.md | 8 +++ packages/cubejs-templates/package.json | 4 +- packages/cubejs-testing-drivers/CHANGELOG.md | 8 +++ packages/cubejs-testing-drivers/package.json | 30 +++++----- packages/cubejs-testing-shared/CHANGELOG.md | 8 +++ packages/cubejs-testing-shared/package.json | 8 +-- packages/cubejs-testing/CHANGELOG.md | 14 +++++ packages/cubejs-testing/package.json | 16 ++--- packages/cubejs-trino-driver/CHANGELOG.md | 8 +++ packages/cubejs-trino-driver/package.json | 10 ++-- rust/cubesql/CHANGELOG.md | 11 ++++ rust/cubesql/package.json | 2 +- rust/cubestore/CHANGELOG.md | 18 ++++++ rust/cubestore/package.json | 4 +- 96 files changed, 701 insertions(+), 211 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8dd8f0421874..7675268c3bf3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,48 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **clickhouse-driver:** Replace error cause with string formatting ([#8977](https://github.com/cube-js/cube/issues/8977)) ([e948856](https://github.com/cube-js/cube/commit/e94885674cf046e9b7188c1b0a6dc4420415a234)) +* **clickhouse-driver:** Tune ClickHouse errors: remove SQL, catch ping failure ([#8983](https://github.com/cube-js/cube/issues/8983)) ([811a7ce](https://github.com/cube-js/cube/commit/811a7ce2e5957de5e619ab9d22342580f22dc366)) +* **cubesql:** fix unhandled timestamp unwrapping in df/transform_response ([#8952](https://github.com/cube-js/cube/issues/8952)) ([4ea0740](https://github.com/cube-js/cube/commit/4ea0740a4001767ab1863c21c062a7e1487fc4e6)) +* **cubestore:** Disable writing cachestore logs by default to reduce use of disk space ([#9003](https://github.com/cube-js/cube/issues/9003)) ([7ccd607](https://github.com/cube-js/cube/commit/7ccd607027d948e867578767a8c3d54604da68da)) +* **dev_env_setup:** Fix incorrect arguments processing and make console output more user-friendly ([#8999](https://github.com/cube-js/cube/issues/8999)) ([ead97b4](https://github.com/cube-js/cube/commit/ead97b41130a87fa6cb963790fad8e7ddac6cdce)) +* **dev_env_setup:** use relative packages everywhere ([#8910](https://github.com/cube-js/cube/issues/8910)) ([ae823c9](https://github.com/cube-js/cube/commit/ae823c9bb09c893b5601d94fea4dfb33eaf426d7)) +* ensure public is in sync with isVisible when using DAP ([#8980](https://github.com/cube-js/cube/issues/8980)) ([a3ed6ea](https://github.com/cube-js/cube/commit/a3ed6ea0d88e644cb4e7506e857a9d4e29c86759)) +* fix data access policies condition logic ([#8976](https://github.com/cube-js/cube/issues/8976)) ([47e7897](https://github.com/cube-js/cube/commit/47e7897f7d16b9e24f350234c093d81f0b599dca)) +* **ksql-driver:** Kafka, list of brokers ([#9009](https://github.com/cube-js/cube/issues/9009)) ([31d4b46](https://github.com/cube-js/cube/commit/31d4b46a0f84e1095924219f4c34eb56b0efc23c)) +* **schema-compiler:** fix FILTER_PARAMS to populate set and notSet filters in cube's SQL query ([#8937](https://github.com/cube-js/cube/issues/8937)) ([6d82f18](https://github.com/cube-js/cube/commit/6d82f18c59f92cae2bb94fe754aa3c0431c24949)), closes [#9009](https://github.com/cube-js/cube/issues/9009) [#8793](https://github.com/cube-js/cube/issues/8793) +* **schema-compiler:** Fix incorrect sql generation for view queries referencing measures from joined cubes ([#8991](https://github.com/cube-js/cube/issues/8991)) ([cd7490e](https://github.com/cube-js/cube/commit/cd7490ef0d5bf3fa1b81b7bf1d820b12a04b1e99)) +* **schema-compiler:** Fix ungrouped cumulative queries incorrect sql generation ([#8981](https://github.com/cube-js/cube/issues/8981)) ([82ba01a](https://github.com/cube-js/cube/commit/82ba01ae3695dc7469e76dd8bced1c532bea0865)) +* **schema-compiler:** Undefined columns for lambda pre-aggregation queries referencing dimensions from joined cubes ([#8946](https://github.com/cube-js/cube/issues/8946)) ([41b49f4](https://github.com/cube-js/cube/commit/41b49f4fc00f30da7c30d59f522970a24b0e1426)) +* **schema-compiler:** use query timezone for time granularity origin ([#8936](https://github.com/cube-js/cube/issues/8936)) ([1beba2d](https://github.com/cube-js/cube/commit/1beba2d3fa6e9a7d95c8c18b448e42fd1562a7e6)) +* **server-core:** fix improper requestId retrieval in DAP ([#9017](https://github.com/cube-js/cube/issues/9017)) ([4e366d3](https://github.com/cube-js/cube/commit/4e366d3375cbc8f2d8fc731a644b2310a41edfc0)) +* **server-core:** fix member level access policy evaluation ([#8992](https://github.com/cube-js/cube/issues/8992)) ([ff89d65](https://github.com/cube-js/cube/commit/ff89d65e74894a5310fa391db50d0147a9510946)) + + +### Features + +* **cubejs-api-gateway:** alternative auth headers ([#8987](https://github.com/cube-js/cube/issues/8987)) ([eb33d1a](https://github.com/cube-js/cube/commit/eb33d1aa6614945f4a73e6c1ef2200abc1917220)) +* **databricks-driver:** Support for intervals and CURRENT_DATE for sql push down ([#9000](https://github.com/cube-js/cube/issues/9000)) ([f61afc3](https://github.com/cube-js/cube/commit/f61afc306b225768f741171a8be9c4c82ec83145)) +* **duckdb-driver:** remove unnecessary installing and loading HttpFS extension ([#8375](https://github.com/cube-js/cube/issues/8375)) ([0aee4fc](https://github.com/cube-js/cube/commit/0aee4fc9b8563e663030cc2aa0f8805114e746e6)) +* **firebolt:** Automatically start the engine after connection ([#9001](https://github.com/cube-js/cube/issues/9001)) ([8f45afa](https://github.com/cube-js/cube/commit/8f45afa28d568ad48b52b44a167f945b61a6e5eb)) +* **pinot-driver:** add optional oAuth headers ([#8953](https://github.com/cube-js/cube/issues/8953)) ([7b1f797](https://github.com/cube-js/cube/commit/7b1f7975102d204c8ca5cf08d91acb9352d63a08)) +* **sqlplanner:** Extract alias logic from the symbols ([#8919](https://github.com/cube-js/cube/issues/8919)) ([d1b07f1](https://github.com/cube-js/cube/commit/d1b07f1029aa50bd391ba9e52bd1b575c3659da9)) + + +### Performance Improvements + +* **cubestore:** ProjectionAboveLimit query optimization ([#8984](https://github.com/cube-js/cube/issues/8984)) ([8a53481](https://github.com/cube-js/cube/commit/8a534817b48b3646439ce2a60dc357ce98e529f2)) +* **cubestore:** Update DataFusion pointer to new GroupsAccumulator changes ([#8985](https://github.com/cube-js/cube/issues/8985)) ([4613628](https://github.com/cube-js/cube/commit/46136282d02573d420afc40fdb3767c9d037c067)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/lerna.json b/lerna.json index 2de263ed018de..15bf5eb0f8cae 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.1.7", + "version": "1.1.8", "npmClient": "yarn", "useWorkspaces": true, "packages": [ diff --git a/packages/cubejs-api-gateway/CHANGELOG.md b/packages/cubejs-api-gateway/CHANGELOG.md index 68a277ec2a5fc..60343c2da6728 100644 --- a/packages/cubejs-api-gateway/CHANGELOG.md +++ b/packages/cubejs-api-gateway/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Features + +* **cubejs-api-gateway:** alternative auth headers ([#8987](https://github.com/cube-js/cube/issues/8987)) ([eb33d1a](https://github.com/cube-js/cube/commit/eb33d1aa6614945f4a73e6c1ef2200abc1917220)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/api-gateway diff --git a/packages/cubejs-api-gateway/package.json b/packages/cubejs-api-gateway/package.json index 743b05142bfa3..539b2d2f88091 100644 --- a/packages/cubejs-api-gateway/package.json +++ b/packages/cubejs-api-gateway/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/api-gateway", "description": "Cube.js API Gateway", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,8 +27,8 @@ "dist/src/*" ], "dependencies": { - "@cubejs-backend/native": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/native": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@ungap/structured-clone": "^0.3.4", "body-parser": "^1.19.0", "chrono-node": "^2.6.2", diff --git a/packages/cubejs-athena-driver/CHANGELOG.md b/packages/cubejs-athena-driver/CHANGELOG.md index 495fea7ce397e..32c637a4496a2 100644 --- a/packages/cubejs-athena-driver/CHANGELOG.md +++ b/packages/cubejs-athena-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/athena-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/athena-driver diff --git a/packages/cubejs-athena-driver/package.json b/packages/cubejs-athena-driver/package.json index bfc5e3a4094db..52e3f234e29ef 100644 --- a/packages/cubejs-athena-driver/package.json +++ b/packages/cubejs-athena-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/athena-driver", "description": "Cube.js Athena database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -29,13 +29,13 @@ "types": "dist/src/index.d.ts", "dependencies": { "@aws-sdk/client-athena": "^3.22.0", - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "sqlstring": "^2.3.1" }, "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "@types/ramda": "^0.27.40", "typescript": "~5.2.2" }, diff --git a/packages/cubejs-backend-cloud/CHANGELOG.md b/packages/cubejs-backend-cloud/CHANGELOG.md index 94e1f968de73e..fd85329452169 100644 --- a/packages/cubejs-backend-cloud/CHANGELOG.md +++ b/packages/cubejs-backend-cloud/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/cloud + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/cloud diff --git a/packages/cubejs-backend-cloud/package.json b/packages/cubejs-backend-cloud/package.json index f0b826f6c3201..741999795eeb2 100644 --- a/packages/cubejs-backend-cloud/package.json +++ b/packages/cubejs-backend-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/cloud", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube Cloud package", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", @@ -32,7 +32,7 @@ }, "dependencies": { "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "chokidar": "^3.5.1", "env-var": "^6.3.0", "fs-extra": "^9.1.0", diff --git a/packages/cubejs-backend-maven/CHANGELOG.md b/packages/cubejs-backend-maven/CHANGELOG.md index 539519fb7ff06..2d3591aaa267e 100644 --- a/packages/cubejs-backend-maven/CHANGELOG.md +++ b/packages/cubejs-backend-maven/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/maven + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/maven diff --git a/packages/cubejs-backend-maven/package.json b/packages/cubejs-backend-maven/package.json index 300db5d52566c..55c5de037dfa5 100644 --- a/packages/cubejs-backend-maven/package.json +++ b/packages/cubejs-backend-maven/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/maven", "description": "Cube.js Maven Wrapper for java dependencies downloading", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "license": "Apache-2.0", "repository": { "type": "git", @@ -31,7 +31,7 @@ "dist/src/*" ], "dependencies": { - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "source-map-support": "^0.5.19", "xmlbuilder2": "^2.4.0" }, diff --git a/packages/cubejs-backend-native/CHANGELOG.md b/packages/cubejs-backend-native/CHANGELOG.md index 0e179312d55eb..dd061ad4dbad0 100644 --- a/packages/cubejs-backend-native/CHANGELOG.md +++ b/packages/cubejs-backend-native/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/native + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/native diff --git a/packages/cubejs-backend-native/package.json b/packages/cubejs-backend-native/package.json index 9f0d7163649c1..6a7b2272174ca 100644 --- a/packages/cubejs-backend-native/package.json +++ b/packages/cubejs-backend-native/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/native", - "version": "1.1.7", + "version": "1.1.8", "author": "Cube Dev, Inc.", "description": "Native module for Cube.js (binding to Rust codebase)", "main": "dist/js/index.js", @@ -43,8 +43,8 @@ "uuid": "^8.3.2" }, "dependencies": { - "@cubejs-backend/cubesql": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/cubesql": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@cubejs-infra/post-installer": "^0.0.7" }, "resources": { diff --git a/packages/cubejs-backend-shared/CHANGELOG.md b/packages/cubejs-backend-shared/CHANGELOG.md index 0b10eb497959d..baebb91db2d67 100644 --- a/packages/cubejs-backend-shared/CHANGELOG.md +++ b/packages/cubejs-backend-shared/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Features + +* **pinot-driver:** add optional oAuth headers ([#8953](https://github.com/cube-js/cube/issues/8953)) ([7b1f797](https://github.com/cube-js/cube/commit/7b1f7975102d204c8ca5cf08d91acb9352d63a08)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/packages/cubejs-backend-shared/package.json b/packages/cubejs-backend-shared/package.json index 00fee5c1b42d5..0fceeb421f6d8 100644 --- a/packages/cubejs-backend-shared/package.json +++ b/packages/cubejs-backend-shared/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/shared", - "version": "1.1.7", + "version": "1.1.8", "description": "Shared code for Cube.js backend packages", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", diff --git a/packages/cubejs-base-driver/CHANGELOG.md b/packages/cubejs-base-driver/CHANGELOG.md index ae0056ffec975..0397935a5a325 100644 --- a/packages/cubejs-base-driver/CHANGELOG.md +++ b/packages/cubejs-base-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/base-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/packages/cubejs-base-driver/package.json b/packages/cubejs-base-driver/package.json index e9c6ac9f91ea9..256ad550d4c5a 100644 --- a/packages/cubejs-base-driver/package.json +++ b/packages/cubejs-base-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/base-driver", "description": "Cube.js Base Driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -33,7 +33,7 @@ "@aws-sdk/s3-request-presigner": "^3.49.0", "@azure/identity": "^4.4.1", "@azure/storage-blob": "^12.9.0", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "@google-cloud/storage": "^7.13.0" }, "devDependencies": { diff --git a/packages/cubejs-bigquery-driver/CHANGELOG.md b/packages/cubejs-bigquery-driver/CHANGELOG.md index c0b2cf3af49a4..9cf2a271963bd 100644 --- a/packages/cubejs-bigquery-driver/CHANGELOG.md +++ b/packages/cubejs-bigquery-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/bigquery-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/bigquery-driver diff --git a/packages/cubejs-bigquery-driver/package.json b/packages/cubejs-bigquery-driver/package.json index 1f69815e3444d..ef7ea20e76eec 100644 --- a/packages/cubejs-bigquery-driver/package.json +++ b/packages/cubejs-bigquery-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/bigquery-driver", "description": "Cube.js BigQuery database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -28,15 +28,15 @@ "main": "index.js", "types": "dist/src/index.d.ts", "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "@google-cloud/bigquery": "^7.7.0", "@google-cloud/storage": "^7.13.0", "ramda": "^0.27.2" }, "devDependencies": { - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "@types/big.js": "^6.2.2", "@types/dedent": "^0.7.0", "@types/jest": "^27", diff --git a/packages/cubejs-cli/CHANGELOG.md b/packages/cubejs-cli/CHANGELOG.md index cc3d3028abf96..1f1e6cdb8f950 100644 --- a/packages/cubejs-cli/CHANGELOG.md +++ b/packages/cubejs-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package cubejs-cli + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package cubejs-cli diff --git a/packages/cubejs-cli/package.json b/packages/cubejs-cli/package.json index 2735abe26a252..fdf36f6e365a0 100644 --- a/packages/cubejs-cli/package.json +++ b/packages/cubejs-cli/package.json @@ -2,7 +2,7 @@ "name": "cubejs-cli", "description": "Cube.js Command Line Interface", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -31,8 +31,8 @@ ], "dependencies": { "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "chalk": "^2.4.2", "cli-progress": "^3.10", "commander": "^2.19.0", @@ -50,7 +50,7 @@ }, "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/server": "1.1.7", + "@cubejs-backend/server": "1.1.8", "@oclif/command": "^1.8.0", "@types/cli-progress": "^3.8.0", "@types/cross-spawn": "^6.0.2", diff --git a/packages/cubejs-clickhouse-driver/CHANGELOG.md b/packages/cubejs-clickhouse-driver/CHANGELOG.md index f4807ceaf8244..4ebda435f56bd 100644 --- a/packages/cubejs-clickhouse-driver/CHANGELOG.md +++ b/packages/cubejs-clickhouse-driver/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **clickhouse-driver:** Replace error cause with string formatting ([#8977](https://github.com/cube-js/cube/issues/8977)) ([e948856](https://github.com/cube-js/cube/commit/e94885674cf046e9b7188c1b0a6dc4420415a234)) +* **clickhouse-driver:** Tune ClickHouse errors: remove SQL, catch ping failure ([#8983](https://github.com/cube-js/cube/issues/8983)) ([811a7ce](https://github.com/cube-js/cube/commit/811a7ce2e5957de5e619ab9d22342580f22dc366)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/packages/cubejs-clickhouse-driver/package.json b/packages/cubejs-clickhouse-driver/package.json index efe75db556a4e..f75bf703ba457 100644 --- a/packages/cubejs-clickhouse-driver/package.json +++ b/packages/cubejs-clickhouse-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/clickhouse-driver", "description": "Cube.js ClickHouse database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -28,8 +28,8 @@ }, "dependencies": { "@clickhouse/client": "^1.7.0", - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "moment": "^2.24.0", "sqlstring": "^2.3.1", "uuid": "^8.3.2" @@ -37,7 +37,7 @@ "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "@types/jest": "^27", "jest": "27", "typescript": "~5.2.2" diff --git a/packages/cubejs-crate-driver/CHANGELOG.md b/packages/cubejs-crate-driver/CHANGELOG.md index 6cbaacd2fe8a9..51976c5216f4f 100644 --- a/packages/cubejs-crate-driver/CHANGELOG.md +++ b/packages/cubejs-crate-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/crate-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/crate-driver diff --git a/packages/cubejs-crate-driver/package.json b/packages/cubejs-crate-driver/package.json index 8c0f98ed922b4..b2536f8b5b4f1 100644 --- a/packages/cubejs-crate-driver/package.json +++ b/packages/cubejs-crate-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/crate-driver", "description": "Cube.js Crate database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -28,14 +28,14 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "pg": "^8.7.1" }, "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "testcontainers": "^10.10.4", "typescript": "~5.2.2" }, diff --git a/packages/cubejs-cubestore-driver/CHANGELOG.md b/packages/cubejs-cubestore-driver/CHANGELOG.md index 538a8dc77e43c..739e968192e65 100644 --- a/packages/cubejs-cubestore-driver/CHANGELOG.md +++ b/packages/cubejs-cubestore-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/cubestore-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/cubestore-driver diff --git a/packages/cubejs-cubestore-driver/package.json b/packages/cubejs-cubestore-driver/package.json index 1108ddd335461..31ea54b0ef334 100644 --- a/packages/cubejs-cubestore-driver/package.json +++ b/packages/cubejs-cubestore-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/cubestore-driver", "description": "Cube Store driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -26,9 +26,9 @@ "lint:fix": "eslint --fix src/*.ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/cubestore": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/cubestore": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "csv-write-stream": "^2.0.0", "flatbuffers": "23.3.3", "fs-extra": "^9.1.0", diff --git a/packages/cubejs-databricks-jdbc-driver/CHANGELOG.md b/packages/cubejs-databricks-jdbc-driver/CHANGELOG.md index f48a745ff5fb5..f939a9bcf20af 100644 --- a/packages/cubejs-databricks-jdbc-driver/CHANGELOG.md +++ b/packages/cubejs-databricks-jdbc-driver/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **schema-compiler:** use query timezone for time granularity origin ([#8936](https://github.com/cube-js/cube/issues/8936)) ([1beba2d](https://github.com/cube-js/cube/commit/1beba2d3fa6e9a7d95c8c18b448e42fd1562a7e6)) + + +### Features + +* **databricks-driver:** Support for intervals and CURRENT_DATE for sql push down ([#9000](https://github.com/cube-js/cube/issues/9000)) ([f61afc3](https://github.com/cube-js/cube/commit/f61afc306b225768f741171a8be9c4c82ec83145)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/databricks-jdbc-driver diff --git a/packages/cubejs-databricks-jdbc-driver/package.json b/packages/cubejs-databricks-jdbc-driver/package.json index 12808438c20a9..c46e35e4755fa 100644 --- a/packages/cubejs-databricks-jdbc-driver/package.json +++ b/packages/cubejs-databricks-jdbc-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/databricks-jdbc-driver", "description": "Cube.js Databricks database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "license": "Apache-2.0", "repository": { "type": "git", @@ -28,10 +28,10 @@ "bin" ], "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/jdbc-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/jdbc-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "node-fetch": "^2.6.1", "ramda": "^0.27.2", "source-map-support": "^0.5.19", diff --git a/packages/cubejs-dbt-schema-extension/CHANGELOG.md b/packages/cubejs-dbt-schema-extension/CHANGELOG.md index 598a7257b3b64..659dd196eeec9 100644 --- a/packages/cubejs-dbt-schema-extension/CHANGELOG.md +++ b/packages/cubejs-dbt-schema-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/dbt-schema-extension + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/dbt-schema-extension diff --git a/packages/cubejs-dbt-schema-extension/package.json b/packages/cubejs-dbt-schema-extension/package.json index 56827e2a8f925..27bd740a8d756 100644 --- a/packages/cubejs-dbt-schema-extension/package.json +++ b/packages/cubejs-dbt-schema-extension/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/dbt-schema-extension", "description": "Cube.js dbt Schema Extension", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,14 +25,14 @@ "lint:fix": "eslint --fix src/* --ext .ts,.js" }, "dependencies": { - "@cubejs-backend/schema-compiler": "1.1.7", + "@cubejs-backend/schema-compiler": "1.1.8", "fs-extra": "^9.1.0", "inflection": "^1.12.0", "node-fetch": "^2.6.1" }, "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing": "1.1.7", + "@cubejs-backend/testing": "1.1.8", "@types/generic-pool": "^3.1.9", "@types/jest": "^27", "jest": "^27", diff --git a/packages/cubejs-docker/CHANGELOG.md b/packages/cubejs-docker/CHANGELOG.md index e3f9eb576c918..235744195676f 100644 --- a/packages/cubejs-docker/CHANGELOG.md +++ b/packages/cubejs-docker/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/docker + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/docker diff --git a/packages/cubejs-docker/package.json b/packages/cubejs-docker/package.json index e20a0cbe7e69c..e28ca4604aed3 100644 --- a/packages/cubejs-docker/package.json +++ b/packages/cubejs-docker/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/docker", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js In Docker (virtual package)", "author": "Cube Dev, Inc.", "license": "Apache-2.0", @@ -9,34 +9,34 @@ "node": "^14.0.0 || ^16.0.0 || >=17.0.0" }, "dependencies": { - "@cubejs-backend/athena-driver": "1.1.7", - "@cubejs-backend/bigquery-driver": "1.1.7", - "@cubejs-backend/clickhouse-driver": "1.1.7", - "@cubejs-backend/crate-driver": "1.1.7", - "@cubejs-backend/databricks-jdbc-driver": "1.1.7", - "@cubejs-backend/dbt-schema-extension": "1.1.7", - "@cubejs-backend/dremio-driver": "1.1.7", - "@cubejs-backend/druid-driver": "1.1.7", - "@cubejs-backend/duckdb-driver": "1.1.7", - "@cubejs-backend/elasticsearch-driver": "1.1.7", - "@cubejs-backend/firebolt-driver": "1.1.7", - "@cubejs-backend/hive-driver": "1.1.7", - "@cubejs-backend/ksql-driver": "1.1.7", - "@cubejs-backend/materialize-driver": "1.1.7", - "@cubejs-backend/mongobi-driver": "1.1.7", - "@cubejs-backend/mssql-driver": "1.1.7", - "@cubejs-backend/mysql-driver": "1.1.7", - "@cubejs-backend/oracle-driver": "1.1.7", - "@cubejs-backend/pinot-driver": "1.1.7", - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/prestodb-driver": "1.1.7", - "@cubejs-backend/questdb-driver": "1.1.7", - "@cubejs-backend/redshift-driver": "1.1.7", - "@cubejs-backend/server": "1.1.7", - "@cubejs-backend/snowflake-driver": "1.1.7", - "@cubejs-backend/sqlite-driver": "1.1.7", - "@cubejs-backend/trino-driver": "1.1.7", - "cubejs-cli": "1.1.7", + "@cubejs-backend/athena-driver": "1.1.8", + "@cubejs-backend/bigquery-driver": "1.1.8", + "@cubejs-backend/clickhouse-driver": "1.1.8", + "@cubejs-backend/crate-driver": "1.1.8", + "@cubejs-backend/databricks-jdbc-driver": "1.1.8", + "@cubejs-backend/dbt-schema-extension": "1.1.8", + "@cubejs-backend/dremio-driver": "1.1.8", + "@cubejs-backend/druid-driver": "1.1.8", + "@cubejs-backend/duckdb-driver": "1.1.8", + "@cubejs-backend/elasticsearch-driver": "1.1.8", + "@cubejs-backend/firebolt-driver": "1.1.8", + "@cubejs-backend/hive-driver": "1.1.8", + "@cubejs-backend/ksql-driver": "1.1.8", + "@cubejs-backend/materialize-driver": "1.1.8", + "@cubejs-backend/mongobi-driver": "1.1.8", + "@cubejs-backend/mssql-driver": "1.1.8", + "@cubejs-backend/mysql-driver": "1.1.8", + "@cubejs-backend/oracle-driver": "1.1.8", + "@cubejs-backend/pinot-driver": "1.1.8", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/prestodb-driver": "1.1.8", + "@cubejs-backend/questdb-driver": "1.1.8", + "@cubejs-backend/redshift-driver": "1.1.8", + "@cubejs-backend/server": "1.1.8", + "@cubejs-backend/snowflake-driver": "1.1.8", + "@cubejs-backend/sqlite-driver": "1.1.8", + "@cubejs-backend/trino-driver": "1.1.8", + "cubejs-cli": "1.1.8", "typescript": "~5.2.2" }, "resolutions": { diff --git a/packages/cubejs-dremio-driver/CHANGELOG.md b/packages/cubejs-dremio-driver/CHANGELOG.md index a9323822239f9..45101e12f7211 100644 --- a/packages/cubejs-dremio-driver/CHANGELOG.md +++ b/packages/cubejs-dremio-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/dremio-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/dremio-driver diff --git a/packages/cubejs-dremio-driver/package.json b/packages/cubejs-dremio-driver/package.json index a2288421fbf92..76336e018a05c 100644 --- a/packages/cubejs-dremio-driver/package.json +++ b/packages/cubejs-dremio-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/dremio-driver", "description": "Cube.js Dremio driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -17,9 +17,9 @@ "lint:fix": "eslint driver/*.js" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "axios": "^0.21.1", "moment-timezone": "^0.5.31", "sqlstring": "^2.3.1" diff --git a/packages/cubejs-druid-driver/CHANGELOG.md b/packages/cubejs-druid-driver/CHANGELOG.md index 9b583e3527419..c150eb05a198d 100644 --- a/packages/cubejs-druid-driver/CHANGELOG.md +++ b/packages/cubejs-druid-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/druid-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/druid-driver diff --git a/packages/cubejs-druid-driver/package.json b/packages/cubejs-druid-driver/package.json index 5cbe046c306be..3dd337385e15d 100644 --- a/packages/cubejs-druid-driver/package.json +++ b/packages/cubejs-druid-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/druid-driver", "description": "Cube.js Druid database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "license": "Apache-2.0", "repository": { "type": "git", @@ -28,9 +28,9 @@ "dist/src/*" ], "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "axios": "^0.21.1", "moment-timezone": "^0.5.31" }, diff --git a/packages/cubejs-duckdb-driver/CHANGELOG.md b/packages/cubejs-duckdb-driver/CHANGELOG.md index 32f835c55d199..42ecb1a780e3a 100644 --- a/packages/cubejs-duckdb-driver/CHANGELOG.md +++ b/packages/cubejs-duckdb-driver/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **schema-compiler:** use query timezone for time granularity origin ([#8936](https://github.com/cube-js/cube/issues/8936)) ([1beba2d](https://github.com/cube-js/cube/commit/1beba2d3fa6e9a7d95c8c18b448e42fd1562a7e6)) + + +### Features + +* **duckdb-driver:** remove unnecessary installing and loading HttpFS extension ([#8375](https://github.com/cube-js/cube/issues/8375)) ([0aee4fc](https://github.com/cube-js/cube/commit/0aee4fc9b8563e663030cc2aa0f8805114e746e6)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/duckdb-driver diff --git a/packages/cubejs-duckdb-driver/package.json b/packages/cubejs-duckdb-driver/package.json index c979adefbfebb..e88377e3490c3 100644 --- a/packages/cubejs-duckdb-driver/package.json +++ b/packages/cubejs-duckdb-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/duckdb-driver", "description": "Cube DuckDB database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,15 +27,15 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "duckdb": "^1.0.0" }, "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "@types/jest": "^27", "@types/node": "^18", "jest": "^27", diff --git a/packages/cubejs-elasticsearch-driver/CHANGELOG.md b/packages/cubejs-elasticsearch-driver/CHANGELOG.md index 88140e8acad39..880aef4c833d6 100644 --- a/packages/cubejs-elasticsearch-driver/CHANGELOG.md +++ b/packages/cubejs-elasticsearch-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/elasticsearch-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/elasticsearch-driver diff --git a/packages/cubejs-elasticsearch-driver/package.json b/packages/cubejs-elasticsearch-driver/package.json index 6288753748088..796e77c82dabc 100644 --- a/packages/cubejs-elasticsearch-driver/package.json +++ b/packages/cubejs-elasticsearch-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/elasticsearch-driver", "description": "Cube.js elasticsearch database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -23,8 +23,8 @@ "driver" ], "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@elastic/elasticsearch": "7.12.0", "sqlstring": "^2.3.1" }, diff --git a/packages/cubejs-firebolt-driver/CHANGELOG.md b/packages/cubejs-firebolt-driver/CHANGELOG.md index f685a1cc7b5a6..29aae6465ea40 100644 --- a/packages/cubejs-firebolt-driver/CHANGELOG.md +++ b/packages/cubejs-firebolt-driver/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Features + +* **firebolt:** Automatically start the engine after connection ([#9001](https://github.com/cube-js/cube/issues/9001)) ([8f45afa](https://github.com/cube-js/cube/commit/8f45afa28d568ad48b52b44a167f945b61a6e5eb)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/firebolt-driver diff --git a/packages/cubejs-firebolt-driver/package.json b/packages/cubejs-firebolt-driver/package.json index 839a35f358546..a0b5398975980 100644 --- a/packages/cubejs-firebolt-driver/package.json +++ b/packages/cubejs-firebolt-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/firebolt-driver", "description": "Cube.js Firebolt database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -28,15 +28,15 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "firebolt-sdk": "^1.8.0" }, "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "typescript": "~5.2.2" }, "publishConfig": { diff --git a/packages/cubejs-hive-driver/CHANGELOG.md b/packages/cubejs-hive-driver/CHANGELOG.md index f979d05788b6d..eca7db9c243e6 100644 --- a/packages/cubejs-hive-driver/CHANGELOG.md +++ b/packages/cubejs-hive-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/hive-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/hive-driver diff --git a/packages/cubejs-hive-driver/package.json b/packages/cubejs-hive-driver/package.json index 160fb480b83fa..ef57625d4cd12 100644 --- a/packages/cubejs-hive-driver/package.json +++ b/packages/cubejs-hive-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/hive-driver", "description": "Cube.js Hive database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -17,8 +17,8 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "generic-pool": "^3.6.0", "jshs2": "^0.4.4", "sasl-plain": "^0.1.0", diff --git a/packages/cubejs-jdbc-driver/CHANGELOG.md b/packages/cubejs-jdbc-driver/CHANGELOG.md index f7c1f58266b7f..ac425025ba23a 100644 --- a/packages/cubejs-jdbc-driver/CHANGELOG.md +++ b/packages/cubejs-jdbc-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/jdbc-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/packages/cubejs-jdbc-driver/package.json b/packages/cubejs-jdbc-driver/package.json index 9e9c2944e23dd..5ae02b73e69a4 100644 --- a/packages/cubejs-jdbc-driver/package.json +++ b/packages/cubejs-jdbc-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/jdbc-driver", "description": "Cube.js JDBC database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,8 +25,8 @@ "index.js" ], "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "generic-pool": "^3.1.7", "node-java-maven": "^0.1.2", "sqlstring": "^2.3.0" diff --git a/packages/cubejs-ksql-driver/CHANGELOG.md b/packages/cubejs-ksql-driver/CHANGELOG.md index 663e487ea4902..719b567707b06 100644 --- a/packages/cubejs-ksql-driver/CHANGELOG.md +++ b/packages/cubejs-ksql-driver/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **ksql-driver:** Kafka, list of brokers ([#9009](https://github.com/cube-js/cube/issues/9009)) ([31d4b46](https://github.com/cube-js/cube/commit/31d4b46a0f84e1095924219f4c34eb56b0efc23c)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/ksql-driver diff --git a/packages/cubejs-ksql-driver/package.json b/packages/cubejs-ksql-driver/package.json index 54909cc839ffe..2da93da808f4f 100644 --- a/packages/cubejs-ksql-driver/package.json +++ b/packages/cubejs-ksql-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/ksql-driver", "description": "Cube.js ksql database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,9 +25,9 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "async-mutex": "0.3.2", "axios": "^0.21.1", "kafkajs": "^2.2.3", diff --git a/packages/cubejs-materialize-driver/CHANGELOG.md b/packages/cubejs-materialize-driver/CHANGELOG.md index 367afa3a58c7f..de9090046e66a 100644 --- a/packages/cubejs-materialize-driver/CHANGELOG.md +++ b/packages/cubejs-materialize-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/materialize-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/materialize-driver diff --git a/packages/cubejs-materialize-driver/package.json b/packages/cubejs-materialize-driver/package.json index 5754e6fe18087..379e837770f22 100644 --- a/packages/cubejs-materialize-driver/package.json +++ b/packages/cubejs-materialize-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/materialize-driver", "description": "Cube.js Materialize database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,9 +27,9 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/pg": "^8.6.0", "pg": "^8.6.0", "semver": "7.3.7" @@ -37,7 +37,7 @@ "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing": "1.1.7", + "@cubejs-backend/testing": "1.1.8", "typescript": "~5.2.2" }, "publishConfig": { diff --git a/packages/cubejs-mongobi-driver/CHANGELOG.md b/packages/cubejs-mongobi-driver/CHANGELOG.md index cbf188ecc38d9..20561cc5385ad 100644 --- a/packages/cubejs-mongobi-driver/CHANGELOG.md +++ b/packages/cubejs-mongobi-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/mongobi-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/mongobi-driver diff --git a/packages/cubejs-mongobi-driver/package.json b/packages/cubejs-mongobi-driver/package.json index 6d79dff17c570..30cae5ca6d87f 100644 --- a/packages/cubejs-mongobi-driver/package.json +++ b/packages/cubejs-mongobi-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/mongobi-driver", "description": "Cube.js MongoBI driver", "author": "krunalsabnis@gmail.com", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,8 +27,8 @@ "integration:mongobi": "jest dist/test" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/node": "^18", "generic-pool": "^3.6.0", "moment": "^2.29.1", diff --git a/packages/cubejs-mssql-driver/CHANGELOG.md b/packages/cubejs-mssql-driver/CHANGELOG.md index 43b18c3dc837d..15a6d97e78cbe 100644 --- a/packages/cubejs-mssql-driver/CHANGELOG.md +++ b/packages/cubejs-mssql-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/mssql-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/mssql-driver diff --git a/packages/cubejs-mssql-driver/package.json b/packages/cubejs-mssql-driver/package.json index def808a8015fc..66743991812be 100644 --- a/packages/cubejs-mssql-driver/package.json +++ b/packages/cubejs-mssql-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/mssql-driver", "description": "Cube.js MS SQL database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -13,7 +13,7 @@ }, "main": "driver/MSSqlDriver.js", "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", "mssql": "^10.0.2" }, "devDependencies": { diff --git a/packages/cubejs-mysql-aurora-serverless-driver/CHANGELOG.md b/packages/cubejs-mysql-aurora-serverless-driver/CHANGELOG.md index af6b5f6100596..2d4fe95f4ad98 100644 --- a/packages/cubejs-mysql-aurora-serverless-driver/CHANGELOG.md +++ b/packages/cubejs-mysql-aurora-serverless-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/mysql-aurora-serverless-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/mysql-aurora-serverless-driver diff --git a/packages/cubejs-mysql-aurora-serverless-driver/package.json b/packages/cubejs-mysql-aurora-serverless-driver/package.json index 43988fea21193..ffdbdb5b75f71 100644 --- a/packages/cubejs-mysql-aurora-serverless-driver/package.json +++ b/packages/cubejs-mysql-aurora-serverless-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/mysql-aurora-serverless-driver", "description": "Cube.js Aurora Serverless Mysql database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -21,8 +21,8 @@ "lint": "eslint driver/*.js test/*.js" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/mysql": "^2.15.15", "aws-sdk": "^2.787.0", "data-api-client": "^1.1.0" diff --git a/packages/cubejs-mysql-driver/CHANGELOG.md b/packages/cubejs-mysql-driver/CHANGELOG.md index fc91fa608df93..34fd4ae069f01 100644 --- a/packages/cubejs-mysql-driver/CHANGELOG.md +++ b/packages/cubejs-mysql-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/mysql-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/mysql-driver diff --git a/packages/cubejs-mysql-driver/package.json b/packages/cubejs-mysql-driver/package.json index 218b62ea1fb44..0996a749a2973 100644 --- a/packages/cubejs-mysql-driver/package.json +++ b/packages/cubejs-mysql-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/mysql-driver", "description": "Cube.js Mysql database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,15 +27,15 @@ "lint:fix": "eslint --fix src/* test/* --ext .ts,.js" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/mysql": "^2.15.21", "generic-pool": "^3.6.0", "mysql": "^2.18.1" }, "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "@types/generic-pool": "^3.1.9", "@types/jest": "^27", "jest": "^27", diff --git a/packages/cubejs-oracle-driver/CHANGELOG.md b/packages/cubejs-oracle-driver/CHANGELOG.md index f6ac22abf7708..36601518d74d3 100644 --- a/packages/cubejs-oracle-driver/CHANGELOG.md +++ b/packages/cubejs-oracle-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/oracle-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/oracle-driver diff --git a/packages/cubejs-oracle-driver/package.json b/packages/cubejs-oracle-driver/package.json index f4bdcb0d0ec6c..252d234587d7d 100644 --- a/packages/cubejs-oracle-driver/package.json +++ b/packages/cubejs-oracle-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/oracle-driver", "description": "Cube.js oracle database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -13,7 +13,7 @@ }, "main": "driver/OracleDriver.js", "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", "ramda": "^0.27.0" }, "optionalDependencies": { diff --git a/packages/cubejs-pinot-driver/CHANGELOG.md b/packages/cubejs-pinot-driver/CHANGELOG.md index a6f8edc612e81..779053278a14c 100644 --- a/packages/cubejs-pinot-driver/CHANGELOG.md +++ b/packages/cubejs-pinot-driver/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Features + +* **pinot-driver:** add optional oAuth headers ([#8953](https://github.com/cube-js/cube/issues/8953)) ([7b1f797](https://github.com/cube-js/cube/commit/7b1f7975102d204c8ca5cf08d91acb9352d63a08)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/pinot-driver diff --git a/packages/cubejs-pinot-driver/package.json b/packages/cubejs-pinot-driver/package.json index af4ce9b552194..b4fcbddbacfcc 100644 --- a/packages/cubejs-pinot-driver/package.json +++ b/packages/cubejs-pinot-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/pinot-driver", "description": "Cube.js Pinot database driver", "author": "Julian Ronsse, InTheMemory, Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,9 +27,9 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "node-fetch": "^2.6.1", "ramda": "^0.27.2", "sqlstring": "^2.3.3" diff --git a/packages/cubejs-postgres-driver/CHANGELOG.md b/packages/cubejs-postgres-driver/CHANGELOG.md index d6ae494d21dd6..41bc37a5037bd 100644 --- a/packages/cubejs-postgres-driver/CHANGELOG.md +++ b/packages/cubejs-postgres-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/postgres-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/postgres-driver diff --git a/packages/cubejs-postgres-driver/package.json b/packages/cubejs-postgres-driver/package.json index d89a4d6131ce3..10c24d6c6e4cb 100644 --- a/packages/cubejs-postgres-driver/package.json +++ b/packages/cubejs-postgres-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/postgres-driver", "description": "Cube.js Postgres database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,8 +27,8 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/pg": "^8.6.0", "@types/pg-query-stream": "^1.0.3", "moment": "^2.24.0", @@ -38,7 +38,7 @@ "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "testcontainers": "^10.10.4", "typescript": "~5.2.2" }, diff --git a/packages/cubejs-prestodb-driver/CHANGELOG.md b/packages/cubejs-prestodb-driver/CHANGELOG.md index 34075ebfad848..7bc63f78c99c3 100644 --- a/packages/cubejs-prestodb-driver/CHANGELOG.md +++ b/packages/cubejs-prestodb-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/prestodb-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/prestodb-driver diff --git a/packages/cubejs-prestodb-driver/package.json b/packages/cubejs-prestodb-driver/package.json index 4615a60eba14a..e4401f9d31695 100644 --- a/packages/cubejs-prestodb-driver/package.json +++ b/packages/cubejs-prestodb-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/prestodb-driver", "description": "Cube.js Presto database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,8 +27,8 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "presto-client": "^0.12.2", "ramda": "^0.27.0", "sqlstring": "^2.3.1" diff --git a/packages/cubejs-query-orchestrator/CHANGELOG.md b/packages/cubejs-query-orchestrator/CHANGELOG.md index 25db5bf17b5cb..d05ba0681049a 100644 --- a/packages/cubejs-query-orchestrator/CHANGELOG.md +++ b/packages/cubejs-query-orchestrator/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/query-orchestrator + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/query-orchestrator diff --git a/packages/cubejs-query-orchestrator/package.json b/packages/cubejs-query-orchestrator/package.json index 48cf869f85ee6..a0a2b0411bb3b 100644 --- a/packages/cubejs-query-orchestrator/package.json +++ b/packages/cubejs-query-orchestrator/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/query-orchestrator", "description": "Cube.js Query Orchestrator and Cache", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -29,9 +29,9 @@ "dist/src/*" ], "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/cubestore-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/cubestore-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "csv-write-stream": "^2.0.0", "es5-ext": "0.10.53", "generic-pool": "^3.7.1", diff --git a/packages/cubejs-questdb-driver/CHANGELOG.md b/packages/cubejs-questdb-driver/CHANGELOG.md index 6bb313f467fbc..cd3e19320cd2a 100644 --- a/packages/cubejs-questdb-driver/CHANGELOG.md +++ b/packages/cubejs-questdb-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/questdb-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/questdb-driver diff --git a/packages/cubejs-questdb-driver/package.json b/packages/cubejs-questdb-driver/package.json index 619fdc0b96875..f7abaf8f54cb0 100644 --- a/packages/cubejs-questdb-driver/package.json +++ b/packages/cubejs-questdb-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/questdb-driver", "description": "Cube.js QuestDB database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -27,9 +27,9 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@types/pg": "^8.6.0", "moment": "^2.24.0", "pg": "^8.7.0", @@ -38,7 +38,7 @@ "license": "Apache-2.0", "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/testing-shared": "1.1.8", "testcontainers": "^10.10.4", "typescript": "~5.2.2" }, diff --git a/packages/cubejs-redshift-driver/CHANGELOG.md b/packages/cubejs-redshift-driver/CHANGELOG.md index d8cc310d82816..1c3b263abd1b6 100644 --- a/packages/cubejs-redshift-driver/CHANGELOG.md +++ b/packages/cubejs-redshift-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/redshift-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/redshift-driver diff --git a/packages/cubejs-redshift-driver/package.json b/packages/cubejs-redshift-driver/package.json index a881c0ad8ca68..ec6efd56faf2d 100644 --- a/packages/cubejs-redshift-driver/package.json +++ b/packages/cubejs-redshift-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/redshift-driver", "description": "Cube.js Redshift database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,9 +25,9 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7" + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8" }, "license": "Apache-2.0", "devDependencies": { diff --git a/packages/cubejs-schema-compiler/CHANGELOG.md b/packages/cubejs-schema-compiler/CHANGELOG.md index edd3cccd284ef..d6fda71838427 100644 --- a/packages/cubejs-schema-compiler/CHANGELOG.md +++ b/packages/cubejs-schema-compiler/CHANGELOG.md @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **schema-compiler:** fix FILTER_PARAMS to populate set and notSet filters in cube's SQL query ([#8937](https://github.com/cube-js/cube/issues/8937)) ([6d82f18](https://github.com/cube-js/cube/commit/6d82f18c59f92cae2bb94fe754aa3c0431c24949)), closes [#9009](https://github.com/cube-js/cube/issues/9009) [#8793](https://github.com/cube-js/cube/issues/8793) +* **schema-compiler:** Fix incorrect sql generation for view queries referencing measures from joined cubes ([#8991](https://github.com/cube-js/cube/issues/8991)) ([cd7490e](https://github.com/cube-js/cube/commit/cd7490ef0d5bf3fa1b81b7bf1d820b12a04b1e99)) +* **schema-compiler:** Fix ungrouped cumulative queries incorrect sql generation ([#8981](https://github.com/cube-js/cube/issues/8981)) ([82ba01a](https://github.com/cube-js/cube/commit/82ba01ae3695dc7469e76dd8bced1c532bea0865)) +* **schema-compiler:** Undefined columns for lambda pre-aggregation queries referencing dimensions from joined cubes ([#8946](https://github.com/cube-js/cube/issues/8946)) ([41b49f4](https://github.com/cube-js/cube/commit/41b49f4fc00f30da7c30d59f522970a24b0e1426)) +* **schema-compiler:** use query timezone for time granularity origin ([#8936](https://github.com/cube-js/cube/issues/8936)) ([1beba2d](https://github.com/cube-js/cube/commit/1beba2d3fa6e9a7d95c8c18b448e42fd1562a7e6)) + + +### Features + +* **sqlplanner:** Extract alias logic from the symbols ([#8919](https://github.com/cube-js/cube/issues/8919)) ([d1b07f1](https://github.com/cube-js/cube/commit/d1b07f1029aa50bd391ba9e52bd1b575c3659da9)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/schema-compiler diff --git a/packages/cubejs-schema-compiler/package.json b/packages/cubejs-schema-compiler/package.json index ee8d87e0c7be1..263e335ae4299 100644 --- a/packages/cubejs-schema-compiler/package.json +++ b/packages/cubejs-schema-compiler/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/schema-compiler", "description": "Cube schema compiler", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -40,8 +40,8 @@ "@babel/standalone": "^7.24", "@babel/traverse": "^7.24", "@babel/types": "^7.24", - "@cubejs-backend/native": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/native": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "antlr4ts": "0.5.0-alpha.4", "camelcase": "^6.2.0", "cron-parser": "^4.9.0", @@ -59,7 +59,7 @@ "devDependencies": { "@clickhouse/client": "^1.7.0", "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/query-orchestrator": "1.1.7", + "@cubejs-backend/query-orchestrator": "1.1.8", "@types/babel__code-frame": "^7.0.6", "@types/babel__generator": "^7.6.8", "@types/babel__traverse": "^7.20.5", diff --git a/packages/cubejs-server-core/CHANGELOG.md b/packages/cubejs-server-core/CHANGELOG.md index 9ffa96d4a1716..7928595d58504 100644 --- a/packages/cubejs-server-core/CHANGELOG.md +++ b/packages/cubejs-server-core/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* ensure public is in sync with isVisible when using DAP ([#8980](https://github.com/cube-js/cube/issues/8980)) ([a3ed6ea](https://github.com/cube-js/cube/commit/a3ed6ea0d88e644cb4e7506e857a9d4e29c86759)) +* fix data access policies condition logic ([#8976](https://github.com/cube-js/cube/issues/8976)) ([47e7897](https://github.com/cube-js/cube/commit/47e7897f7d16b9e24f350234c093d81f0b599dca)) +* **server-core:** fix improper requestId retrieval in DAP ([#9017](https://github.com/cube-js/cube/issues/9017)) ([4e366d3](https://github.com/cube-js/cube/commit/4e366d3375cbc8f2d8fc731a644b2310a41edfc0)) +* **server-core:** fix member level access policy evaluation ([#8992](https://github.com/cube-js/cube/issues/8992)) ([ff89d65](https://github.com/cube-js/cube/commit/ff89d65e74894a5310fa391db50d0147a9510946)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/server-core diff --git a/packages/cubejs-server-core/package.json b/packages/cubejs-server-core/package.json index b8f8dacf297d8..1e4e64477eeb5 100644 --- a/packages/cubejs-server-core/package.json +++ b/packages/cubejs-server-core/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/server-core", "description": "Cube.js base component to wire all backend components together", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -29,14 +29,14 @@ "unit": "jest --runInBand --forceExit --coverage dist/test" }, "dependencies": { - "@cubejs-backend/api-gateway": "1.1.7", - "@cubejs-backend/cloud": "1.1.7", + "@cubejs-backend/api-gateway": "1.1.8", + "@cubejs-backend/cloud": "1.1.8", "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/native": "1.1.7", - "@cubejs-backend/query-orchestrator": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", - "@cubejs-backend/templates": "1.1.7", + "@cubejs-backend/native": "1.1.8", + "@cubejs-backend/query-orchestrator": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", + "@cubejs-backend/templates": "1.1.8", "codesandbox-import-utils": "^2.1.12", "cross-spawn": "^7.0.1", "fs-extra": "^8.1.0", @@ -57,7 +57,7 @@ "ws": "^7.5.3" }, "devDependencies": { - "@cubejs-backend/cubestore-driver": "1.1.7", + "@cubejs-backend/cubestore-driver": "1.1.8", "@cubejs-backend/linter": "^1.0.0", "@cubejs-client/playground": "1.1.6", "@types/cross-spawn": "^6.0.2", diff --git a/packages/cubejs-server/CHANGELOG.md b/packages/cubejs-server/CHANGELOG.md index 42110c661bfed..9a4ac29f501f0 100644 --- a/packages/cubejs-server/CHANGELOG.md +++ b/packages/cubejs-server/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/server + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/server diff --git a/packages/cubejs-server/package.json b/packages/cubejs-server/package.json index 2f76cd414445c..ac8ba1a7f7b3d 100644 --- a/packages/cubejs-server/package.json +++ b/packages/cubejs-server/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/server", "description": "Cube.js all-in-one server", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "types": "index.d.ts", "repository": { "type": "git", @@ -40,11 +40,11 @@ "jest:shapshot": "jest --updateSnapshot test" }, "dependencies": { - "@cubejs-backend/cubestore-driver": "1.1.7", + "@cubejs-backend/cubestore-driver": "1.1.8", "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/native": "1.1.7", - "@cubejs-backend/server-core": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/native": "1.1.8", + "@cubejs-backend/server-core": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@oclif/color": "^1.0.0", "@oclif/command": "^1.8.13", "@oclif/config": "^1.18.2", @@ -62,7 +62,7 @@ }, "devDependencies": { "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/query-orchestrator": "1.1.7", + "@cubejs-backend/query-orchestrator": "1.1.8", "@oclif/dev-cli": "^1.23.1", "@types/body-parser": "^1.19.0", "@types/cors": "^2.8.8", diff --git a/packages/cubejs-snowflake-driver/CHANGELOG.md b/packages/cubejs-snowflake-driver/CHANGELOG.md index 16438004bdd50..ff2db4cb1ebe6 100644 --- a/packages/cubejs-snowflake-driver/CHANGELOG.md +++ b/packages/cubejs-snowflake-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/snowflake-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/snowflake-driver diff --git a/packages/cubejs-snowflake-driver/package.json b/packages/cubejs-snowflake-driver/package.json index ad3f135b6cd7b..f8715e6ced8ad 100644 --- a/packages/cubejs-snowflake-driver/package.json +++ b/packages/cubejs-snowflake-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/snowflake-driver", "description": "Cube.js Snowflake database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,8 +25,8 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "date-fns-timezone": "^0.1.4", "snowflake-sdk": "^1.13.1" }, diff --git a/packages/cubejs-sqlite-driver/CHANGELOG.md b/packages/cubejs-sqlite-driver/CHANGELOG.md index 8dbcea2ed8797..dab1919e98f43 100644 --- a/packages/cubejs-sqlite-driver/CHANGELOG.md +++ b/packages/cubejs-sqlite-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/sqlite-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/sqlite-driver diff --git a/packages/cubejs-sqlite-driver/package.json b/packages/cubejs-sqlite-driver/package.json index 86d3e98e1f926..d5fba86fd4a7d 100644 --- a/packages/cubejs-sqlite-driver/package.json +++ b/packages/cubejs-sqlite-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/sqlite-driver", "description": "Cube.js Sqlite database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -17,8 +17,8 @@ "lint": "eslint **/*.js" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "sqlite3": "^5.1.7" }, "license": "Apache-2.0", diff --git a/packages/cubejs-templates/CHANGELOG.md b/packages/cubejs-templates/CHANGELOG.md index 3a6477ea6c941..2e7b5867db120 100644 --- a/packages/cubejs-templates/CHANGELOG.md +++ b/packages/cubejs-templates/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/templates + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/templates diff --git a/packages/cubejs-templates/package.json b/packages/cubejs-templates/package.json index 6e82814890b55..e6e7c8bd4b8f4 100644 --- a/packages/cubejs-templates/package.json +++ b/packages/cubejs-templates/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/templates", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js Templates helpers", "author": "Cube Dev, Inc.", "license": "Apache-2.0", @@ -26,7 +26,7 @@ "extends": "../cubejs-linter" }, "dependencies": { - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "cross-spawn": "^7.0.3", "decompress": "^4.2.1", "decompress-targz": "^4.1.1", diff --git a/packages/cubejs-testing-drivers/CHANGELOG.md b/packages/cubejs-testing-drivers/CHANGELOG.md index 055ce5e37a468..2156e346bca18 100644 --- a/packages/cubejs-testing-drivers/CHANGELOG.md +++ b/packages/cubejs-testing-drivers/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/testing-drivers + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/packages/cubejs-testing-drivers/package.json b/packages/cubejs-testing-drivers/package.json index 614ee2ab11298..b53e32aee3688 100644 --- a/packages/cubejs-testing-drivers/package.json +++ b/packages/cubejs-testing-drivers/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/testing-drivers", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js drivers test suite", "author": "Cube Dev, Inc.", "license": "MIT", @@ -56,22 +56,22 @@ "dist/src" ], "dependencies": { - "@cubejs-backend/athena-driver": "1.1.7", - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/bigquery-driver": "1.1.7", - "@cubejs-backend/clickhouse-driver": "1.1.7", - "@cubejs-backend/cubestore-driver": "1.1.7", - "@cubejs-backend/databricks-jdbc-driver": "1.1.7", + "@cubejs-backend/athena-driver": "1.1.8", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/bigquery-driver": "1.1.8", + "@cubejs-backend/clickhouse-driver": "1.1.8", + "@cubejs-backend/cubestore-driver": "1.1.8", + "@cubejs-backend/databricks-jdbc-driver": "1.1.8", "@cubejs-backend/dotenv": "^9.0.2", "@cubejs-backend/linter": "^1.0.0", - "@cubejs-backend/mssql-driver": "1.1.7", - "@cubejs-backend/mysql-driver": "1.1.7", - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/query-orchestrator": "1.1.7", - "@cubejs-backend/server-core": "1.1.7", - "@cubejs-backend/shared": "1.1.7", - "@cubejs-backend/snowflake-driver": "1.1.7", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/mssql-driver": "1.1.8", + "@cubejs-backend/mysql-driver": "1.1.8", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/query-orchestrator": "1.1.8", + "@cubejs-backend/server-core": "1.1.8", + "@cubejs-backend/shared": "1.1.8", + "@cubejs-backend/snowflake-driver": "1.1.8", + "@cubejs-backend/testing-shared": "1.1.8", "@cubejs-client/core": "^1.0.0", "@cubejs-client/ws-transport": "^1.0.0", "@jest/globals": "^27", diff --git a/packages/cubejs-testing-shared/CHANGELOG.md b/packages/cubejs-testing-shared/CHANGELOG.md index b72a6044c3d77..39f7b8d2d815e 100644 --- a/packages/cubejs-testing-shared/CHANGELOG.md +++ b/packages/cubejs-testing-shared/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/testing-shared + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/testing-shared diff --git a/packages/cubejs-testing-shared/package.json b/packages/cubejs-testing-shared/package.json index 69ec740d42f50..647a2e94af942 100644 --- a/packages/cubejs-testing-shared/package.json +++ b/packages/cubejs-testing-shared/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/testing-shared", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js Testing Helpers", "author": "Cube Dev, Inc.", "license": "Apache-2.0", @@ -21,9 +21,9 @@ ], "dependencies": { "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/query-orchestrator": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/query-orchestrator": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "@testcontainers/kafka": "~10.13.0", "dedent": "^0.7.0", "node-fetch": "^2.6.7", diff --git a/packages/cubejs-testing/CHANGELOG.md b/packages/cubejs-testing/CHANGELOG.md index dc97454369ff7..cb5bc470c5169 100644 --- a/packages/cubejs-testing/CHANGELOG.md +++ b/packages/cubejs-testing/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* ensure public is in sync with isVisible when using DAP ([#8980](https://github.com/cube-js/cube/issues/8980)) ([a3ed6ea](https://github.com/cube-js/cube/commit/a3ed6ea0d88e644cb4e7506e857a9d4e29c86759)) +* fix data access policies condition logic ([#8976](https://github.com/cube-js/cube/issues/8976)) ([47e7897](https://github.com/cube-js/cube/commit/47e7897f7d16b9e24f350234c093d81f0b599dca)) +* **schema-compiler:** Fix incorrect sql generation for view queries referencing measures from joined cubes ([#8991](https://github.com/cube-js/cube/issues/8991)) ([cd7490e](https://github.com/cube-js/cube/commit/cd7490ef0d5bf3fa1b81b7bf1d820b12a04b1e99)) +* **server-core:** fix member level access policy evaluation ([#8992](https://github.com/cube-js/cube/issues/8992)) ([ff89d65](https://github.com/cube-js/cube/commit/ff89d65e74894a5310fa391db50d0147a9510946)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/testing diff --git a/packages/cubejs-testing/package.json b/packages/cubejs-testing/package.json index 136ed2c5655c3..54182dabbfc5a 100644 --- a/packages/cubejs-testing/package.json +++ b/packages/cubejs-testing/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/testing", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js e2e tests", "author": "Cube Dev, Inc.", "license": "Apache-2.0", @@ -90,14 +90,14 @@ "birdbox-fixtures" ], "dependencies": { - "@cubejs-backend/cubestore-driver": "1.1.7", + "@cubejs-backend/cubestore-driver": "1.1.8", "@cubejs-backend/dotenv": "^9.0.2", - "@cubejs-backend/ksql-driver": "1.1.7", - "@cubejs-backend/postgres-driver": "1.1.7", - "@cubejs-backend/query-orchestrator": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", - "@cubejs-backend/testing-shared": "1.1.7", + "@cubejs-backend/ksql-driver": "1.1.8", + "@cubejs-backend/postgres-driver": "1.1.8", + "@cubejs-backend/query-orchestrator": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", + "@cubejs-backend/testing-shared": "1.1.8", "@cubejs-client/ws-transport": "^1.0.0", "dedent": "^0.7.0", "fs-extra": "^8.1.0", diff --git a/packages/cubejs-trino-driver/CHANGELOG.md b/packages/cubejs-trino-driver/CHANGELOG.md index 991fd35d82ab3..7a7f120d30f76 100644 --- a/packages/cubejs-trino-driver/CHANGELOG.md +++ b/packages/cubejs-trino-driver/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + +**Note:** Version bump only for package @cubejs-backend/trino-driver + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/trino-driver diff --git a/packages/cubejs-trino-driver/package.json b/packages/cubejs-trino-driver/package.json index dd4adcc2b5643..dc65c7b1543dc 100644 --- a/packages/cubejs-trino-driver/package.json +++ b/packages/cubejs-trino-driver/package.json @@ -2,7 +2,7 @@ "name": "@cubejs-backend/trino-driver", "description": "Cube.js Trino database driver", "author": "Cube Dev, Inc.", - "version": "1.1.7", + "version": "1.1.8", "repository": { "type": "git", "url": "https://github.com/cube-js/cube.git", @@ -25,10 +25,10 @@ "lint:fix": "eslint --fix src/* --ext .ts" }, "dependencies": { - "@cubejs-backend/base-driver": "1.1.7", - "@cubejs-backend/prestodb-driver": "1.1.7", - "@cubejs-backend/schema-compiler": "1.1.7", - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/base-driver": "1.1.8", + "@cubejs-backend/prestodb-driver": "1.1.8", + "@cubejs-backend/schema-compiler": "1.1.8", + "@cubejs-backend/shared": "1.1.8", "presto-client": "^0.12.2", "sqlstring": "^2.3.1" }, diff --git a/rust/cubesql/CHANGELOG.md b/rust/cubesql/CHANGELOG.md index 6fe71b4d9d8c1..3be61332aa828 100644 --- a/rust/cubesql/CHANGELOG.md +++ b/rust/cubesql/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **cubesql:** fix unhandled timestamp unwrapping in df/transform_response ([#8952](https://github.com/cube-js/cube/issues/8952)) ([4ea0740](https://github.com/cube-js/cube/commit/4ea0740a4001767ab1863c21c062a7e1487fc4e6)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) diff --git a/rust/cubesql/package.json b/rust/cubesql/package.json index fe24f7c634351..bbb475ea7fa02 100644 --- a/rust/cubesql/package.json +++ b/rust/cubesql/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/cubesql", - "version": "1.1.7", + "version": "1.1.8", "description": "SQL API for Cube as proxy over MySQL protocol.", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" diff --git a/rust/cubestore/CHANGELOG.md b/rust/cubestore/CHANGELOG.md index ba066bc568112..05487bfbc7fec 100644 --- a/rust/cubestore/CHANGELOG.md +++ b/rust/cubestore/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.8](https://github.com/cube-js/cube/compare/v1.1.7...v1.1.8) (2024-12-05) + + +### Bug Fixes + +* **cubestore:** Disable writing cachestore logs by default to reduce use of disk space ([#9003](https://github.com/cube-js/cube/issues/9003)) ([7ccd607](https://github.com/cube-js/cube/commit/7ccd607027d948e867578767a8c3d54604da68da)) +* **ksql-driver:** Kafka, list of brokers ([#9009](https://github.com/cube-js/cube/issues/9009)) ([31d4b46](https://github.com/cube-js/cube/commit/31d4b46a0f84e1095924219f4c34eb56b0efc23c)) + + +### Performance Improvements + +* **cubestore:** ProjectionAboveLimit query optimization ([#8984](https://github.com/cube-js/cube/issues/8984)) ([8a53481](https://github.com/cube-js/cube/commit/8a534817b48b3646439ce2a60dc357ce98e529f2)) +* **cubestore:** Update DataFusion pointer to new GroupsAccumulator changes ([#8985](https://github.com/cube-js/cube/issues/8985)) ([4613628](https://github.com/cube-js/cube/commit/46136282d02573d420afc40fdb3767c9d037c067)) + + + + + ## [1.1.7](https://github.com/cube-js/cube/compare/v1.1.6...v1.1.7) (2024-11-20) **Note:** Version bump only for package @cubejs-backend/cubestore diff --git a/rust/cubestore/package.json b/rust/cubestore/package.json index d07bfad7033f5..2066d5ebf210b 100644 --- a/rust/cubestore/package.json +++ b/rust/cubestore/package.json @@ -1,6 +1,6 @@ { "name": "@cubejs-backend/cubestore", - "version": "1.1.7", + "version": "1.1.8", "description": "Cube.js pre-aggregation storage layer.", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", @@ -37,7 +37,7 @@ "access": "public" }, "dependencies": { - "@cubejs-backend/shared": "1.1.7", + "@cubejs-backend/shared": "1.1.8", "@octokit/core": "^3.2.5", "source-map-support": "^0.5.19" }, From e9fdf95aa08965ec7086b58679d47fad7adc78cf Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Fri, 6 Dec 2024 11:46:55 +0200 Subject: [PATCH 07/11] ci: Switch macos-12 runner to macos-13 (#9022) macOS 12 runner is unsupported since 2024-12-03 See https://github.com/actions/runner-images/issues/10721 --- .github/workflows/publish.yml | 4 ++-- .github/workflows/rust-cubestore-master.yml | 2 +- .github/workflows/rust-cubestore.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d0c83b46eda99..92d896a6421bd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -152,7 +152,7 @@ jobs: strategy: matrix: node-version: [20.x] - os-version: ["macos-12"] + os-version: ["macos-13"] target: ["x86_64-apple-darwin", "aarch64-apple-darwin"] python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"] include: @@ -677,7 +677,7 @@ jobs: tar_executable: tar # Please use minimal possible version of macOS, because it produces constraint on libstdc++ - target: x86_64-apple-darwin - os: macos-12 + os: macos-13 executable_name: cubestored # upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05. strip: false diff --git a/.github/workflows/rust-cubestore-master.yml b/.github/workflows/rust-cubestore-master.yml index 42f2a3837a2c6..29211f7c24a83 100644 --- a/.github/workflows/rust-cubestore-master.yml +++ b/.github/workflows/rust-cubestore-master.yml @@ -196,7 +196,7 @@ jobs: # cubestored.exe: CantPackException: superfluous data between sections compress: false # Please use minimal possible version of macOS, because it produces constraint on libstdc++ - - os: macos-12 + - os: macos-13 target: x86_64-apple-darwin executable_name: cubestored # upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05. diff --git a/.github/workflows/rust-cubestore.yml b/.github/workflows/rust-cubestore.yml index 9cbe945fb9bfb..3b4a2eb6182c3 100644 --- a/.github/workflows/rust-cubestore.yml +++ b/.github/workflows/rust-cubestore.yml @@ -127,7 +127,7 @@ jobs: # cubestored.exe: CantPackException: superfluous data between sections compress: false # Please use minimal possible version of macOS, because it produces constraint on libstdc++ - - os: macos-12 + - os: macos-13 target: x86_64-apple-darwin executable_name: cubestored # upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05. From 5b10a68b4aca8e5050291fa3ca85dd5f3edc6614 Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Fri, 6 Dec 2024 13:06:58 +0200 Subject: [PATCH 08/11] fix(cubesql): Allow aggregation pushdown only for unlimited CubeScan (#8929) Also disallow pulling up push-to-Cube wrapper over CubeScan with limit --- .../src/compile/rewrite/rules/members.rs | 11 +- .../rules/wrapper/cube_scan_wrapper.rs | 26 +++- .../cubesql/src/compile/test/test_wrapper.rs | 125 ++++++++++++++++++ 3 files changed, 155 insertions(+), 7 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs b/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs index 1c123c1242fe3..d6cbe46d2a8f3 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs @@ -137,8 +137,11 @@ impl RewriteRules for MemberRules { "?old_members", "?filters", "?orders", - "?limit", - "?offset", + // If CubeScan already have limit and offset it would be incorrect to push aggregation into it + // Aggregate(CubeScan(limit, offset)) would run aggregation over limited rows + // CubeScan(aggregation, limit, offset) would return limited groups + "CubeScanLimit:None", + "CubeScanOffset:None", "?split", "?can_pushdown_join", "CubeScanWrapped:false", @@ -164,8 +167,8 @@ impl RewriteRules for MemberRules { ), "?filters", "?orders", - "?limit", - "?offset", + "CubeScanLimit:None", + "CubeScanOffset:None", "?split", "?new_pushdown_join", "CubeScanWrapped:false", diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rules/wrapper/cube_scan_wrapper.rs b/rust/cubesql/cubesql/src/compile/rewrite/rules/wrapper/cube_scan_wrapper.rs index 29ae2e2328df2..1e7cccd145534 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rules/wrapper/cube_scan_wrapper.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rules/wrapper/cube_scan_wrapper.rs @@ -3,8 +3,9 @@ use crate::{ cube_scan, cube_scan_wrapper, rewrite, rewriter::{CubeEGraph, CubeRewrite}, rules::wrapper::WrapperRules, - transforming_rewrite, wrapper_pullup_replacer, CubeScanAliasToCube, CubeScanUngrouped, - LogicalPlanLanguage, WrapperPullupReplacerAliasToCube, WrapperPullupReplacerPushToCube, + transforming_rewrite, wrapper_pullup_replacer, CubeScanAliasToCube, CubeScanLimit, + CubeScanOffset, CubeScanUngrouped, LogicalPlanLanguage, WrapperPullupReplacerAliasToCube, + WrapperPullupReplacerPushToCube, }, var, var_iter, }; @@ -51,6 +52,8 @@ impl WrapperRules { self.transform_wrap_cube_scan( "?members", "?alias_to_cube", + "?limit", + "?offset", "?ungrouped", "?alias_to_cube_out", "?push_to_cube_out", @@ -77,16 +80,28 @@ impl WrapperRules { &self, members_var: &'static str, alias_to_cube_var: &'static str, + limit_var: &'static str, + offset_var: &'static str, ungrouped_cube_var: &'static str, alias_to_cube_var_out: &'static str, push_to_cube_out_var: &'static str, ) -> impl Fn(&mut CubeEGraph, &mut Subst) -> bool { let members_var = var!(members_var); let alias_to_cube_var = var!(alias_to_cube_var); + let limit_var = var!(limit_var); + let offset_var = var!(offset_var); let ungrouped_cube_var = var!(ungrouped_cube_var); let alias_to_cube_var_out = var!(alias_to_cube_var_out); let push_to_cube_out_var = var!(push_to_cube_out_var); move |egraph, subst| { + let mut has_no_limit_or_offset = true; + for limit in var_iter!(egraph[subst[limit_var]], CubeScanLimit).cloned() { + has_no_limit_or_offset &= limit.is_none(); + } + for offset in var_iter!(egraph[subst[offset_var]], CubeScanOffset).cloned() { + has_no_limit_or_offset &= offset.is_none(); + } + if let Some(_) = egraph[subst[members_var]].data.member_name_to_expr { for alias_to_cube in var_iter!(egraph[subst[alias_to_cube_var]], CubeScanAliasToCube).cloned() @@ -94,10 +109,15 @@ impl WrapperRules { for ungrouped in var_iter!(egraph[subst[ungrouped_cube_var]], CubeScanUngrouped).cloned() { + // When CubeScan already has limit or offset, it's unsafe to allow to push + // anything on top to Cube. + // Especially aggregation: aggregate does not commute with limit, + // so it would be incorrect to join them to single CubeScan + let push_to_cube_out = ungrouped && has_no_limit_or_offset; subst.insert( push_to_cube_out_var, egraph.add(LogicalPlanLanguage::WrapperPullupReplacerPushToCube( - WrapperPullupReplacerPushToCube(ungrouped), + WrapperPullupReplacerPushToCube(push_to_cube_out), )), ); subst.insert( diff --git a/rust/cubesql/cubesql/src/compile/test/test_wrapper.rs b/rust/cubesql/cubesql/src/compile/test/test_wrapper.rs index 5f5f039d0944d..6fcdaa5e38452 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_wrapper.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_wrapper.rs @@ -1,3 +1,4 @@ +use cubeclient::models::V1LoadRequestQuery; use datafusion::physical_plan::displayable; use pretty_assertions::assert_eq; use serde_json::json; @@ -1258,3 +1259,127 @@ async fn test_wrapper_filter_flatten() { } ); } + +/// Regular aggregation over CubeScan(limit=n, ungrouped=true) is NOT pushed to CubeScan +#[tokio::test] +async fn wrapper_agg_over_limit() { + if !Rewriter::sql_push_down_enabled() { + return; + } + init_testing_logger(); + + let query_plan = convert_select_to_query_plan( + // language=PostgreSQL + r#" + SELECT + customer_gender + FROM ( + SELECT + customer_gender + FROM + KibanaSampleDataEcommerce + LIMIT 5 + ) scan + GROUP BY + 1 + "# + .to_string(), + DatabaseProtocol::PostgreSQL, + ) + .await; + + let physical_plan = query_plan.as_physical_plan().await.unwrap(); + println!( + "Physical plan: {}", + displayable(physical_plan.as_ref()).indent() + ); + + let logical_plan = query_plan.as_logical_plan(); + assert_eq!( + logical_plan.find_cube_scan().request, + V1LoadRequestQuery { + measures: Some(vec![]), + dimensions: Some(vec![]), + segments: Some(vec![]), + order: Some(vec![]), + limit: Some(5), + ungrouped: Some(true), + ..Default::default() + } + ); + + assert!(logical_plan + .find_cube_scan_wrapper() + .wrapped_sql + .unwrap() + .sql + .contains("\"limit\": 5")); + assert!(query_plan + .as_logical_plan() + .find_cube_scan_wrapper() + .wrapped_sql + .unwrap() + .sql + .contains("\"ungrouped\": true")); +} + +/// Aggregation(dimension) over CubeScan(limit=n, ungrouped=true) is NOT pushed to CubeScan +#[tokio::test] +async fn wrapper_agg_dimension_over_limit() { + if !Rewriter::sql_push_down_enabled() { + return; + } + init_testing_logger(); + + let query_plan = convert_select_to_query_plan( + // language=PostgreSQL + r#" + SELECT + MAX(customer_gender) + FROM ( + SELECT + customer_gender + FROM + KibanaSampleDataEcommerce + LIMIT 5 + ) scan + "# + .to_string(), + DatabaseProtocol::PostgreSQL, + ) + .await; + + let physical_plan = query_plan.as_physical_plan().await.unwrap(); + println!( + "Physical plan: {}", + displayable(physical_plan.as_ref()).indent() + ); + + let logical_plan = query_plan.as_logical_plan(); + assert_eq!( + logical_plan.find_cube_scan().request, + V1LoadRequestQuery { + measures: Some(vec![]), + dimensions: Some(vec![]), + segments: Some(vec![]), + order: Some(vec![]), + limit: Some(5), + ungrouped: Some(true), + ..Default::default() + } + ); + + assert!(logical_plan + .find_cube_scan_wrapper() + .wrapped_sql + .unwrap() + .sql + .contains("\"limit\": 5")); + assert!(query_plan + .as_logical_plan() + .find_cube_scan_wrapper() + .wrapped_sql + .unwrap() + .sql + .contains("\"ungrouped\": true")); +} From 060d666281b3e1ddaa3b71dd3f9c0eafd35a40a6 Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Fri, 6 Dec 2024 14:38:31 +0200 Subject: [PATCH 09/11] refactor(cubesql): Remove Extension from LogicalPlanLanguage::CubeScan (#8775) Extensions is used meaningfully only for CubeScan, but not for CubeScanWrapper. Both are first-class logical plan nodes for us, so Extension is not helpful in egraph --- .../cubesql/src/compile/rewrite/analysis.rs | 1 - .../cubesql/src/compile/rewrite/converter.rs | 995 ++++++++---------- .../cubesql/src/compile/rewrite/mod.rs | 2 +- 3 files changed, 468 insertions(+), 530 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs b/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs index da252cef9e141..f0af8e3396fa3 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs @@ -1242,7 +1242,6 @@ impl LogicalPlanAnalysis { Some(c.to_string()) } LogicalPlanLanguage::CubeScan(params) => cube_reference(params[0]), - LogicalPlanLanguage::Extension(params) => cube_reference(params[0]), _ => None, } } diff --git a/rust/cubesql/cubesql/src/compile/rewrite/converter.rs b/rust/cubesql/cubesql/src/compile/rewrite/converter.rs index d1944d123c908..99d5057e706f3 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/converter.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/converter.rs @@ -786,12 +786,7 @@ impl LogicalPlanToLanguageConverter { } // TODO LogicalPlan::Extension(ext) => { - if let Some(_cube_scan) = ext.node.as_any().downcast_ref::() { - todo!("LogicalPlanLanguage::Extension"); - // self.graph.add(LogicalPlanLanguage::Extension([])) - } else { - panic!("Unsupported extension node: {}", ext.node.schema()); - } + panic!("Unsupported extension node: {}", ext.node.schema()); } LogicalPlan::Distinct(distinct) => { let input = self.add_logical_plan_replace_params( @@ -1531,559 +1526,505 @@ impl LanguageToLogicalPlanConverter { // panic!("Analyze is not supported"); // } LogicalPlanLanguage::Extension(params) => { - let node = match self.best_expr.index(params[0]) { - LogicalPlanLanguage::CubeScan(cube_scan_params) => { - let alias_to_cube = - match_data_node!(node_by_id, cube_scan_params[0], CubeScanAliasToCube); - let members = - match_list_node!(node_by_id, cube_scan_params[1], CubeScanMembers); - let order = - match_list_node!(node_by_id, cube_scan_params[3], CubeScanOrder); - let wrapped = - match_data_node!(node_by_id, cube_scan_params[8], CubeScanWrapped); - // TODO filters - // TODO - let mut query = V1LoadRequestQuery::new(); - let mut fields = Vec::new(); - let mut query_measures = Vec::new(); - let mut query_time_dimensions = Vec::new(); - let mut query_order = Vec::new(); - let mut query_dimensions = Vec::new(); - - for m in members { - match m { - LogicalPlanLanguage::Measure(measure_params) => { - let measure = match_data_node!( - node_by_id, - measure_params[0], - MeasureName - ); - let expr = self.to_expr(measure_params[1])?; - query_measures.push(measure.to_string()); - let data_type = self - .cube_context - .meta - .find_df_data_type(measure.to_string()) - .ok_or(CubeError::internal(format!( - "Can't find measure '{}'", - measure - )))?; - fields.push(( - DFField::new( - expr_relation(&expr), - &expr_name(&expr)?, - data_type, - true, - ), - MemberField::Member(measure.to_string()), - )); - } - LogicalPlanLanguage::TimeDimension(params) => { - let dimension = - match_data_node!(node_by_id, params[0], TimeDimensionName); - let granularity = match_data_node!( - node_by_id, - params[1], - TimeDimensionGranularity - ); - let date_range = match_data_node!( - node_by_id, - params[2], - TimeDimensionDateRange - ); - let expr = self.to_expr(params[3])?; - let query_time_dimension = V1LoadRequestQueryTimeDimension { - dimension: dimension.to_string(), - granularity: granularity.clone(), - date_range: date_range.map(|date_range| { - serde_json::Value::Array( - date_range - .into_iter() - .map(|d| serde_json::Value::String(d)) - .collect(), - ) - }), - }; - if !query_time_dimensions.contains(&query_time_dimension) { - query_time_dimensions.push(query_time_dimension); - } - if let Some(granularity) = &granularity { - fields.push(( - DFField::new( - expr_relation(&expr), - // TODO empty schema - &expr_name(&expr)?, - DataType::Timestamp(TimeUnit::Nanosecond, None), - true, - ), - MemberField::Member(format!( - "{}.{}", - dimension, granularity - )), - )); - } - } - LogicalPlanLanguage::Dimension(params) => { - let dimension = - match_data_node!(node_by_id, params[0], DimensionName); - let expr = self.to_expr(params[1])?; - let data_type = self + panic!("Unexpected extension node: {:?}", params[0]) + } + LogicalPlanLanguage::CubeScan(cube_scan_params) => { + let alias_to_cube = + match_data_node!(node_by_id, cube_scan_params[0], CubeScanAliasToCube); + let members = match_list_node!(node_by_id, cube_scan_params[1], CubeScanMembers); + let order = match_list_node!(node_by_id, cube_scan_params[3], CubeScanOrder); + let wrapped = match_data_node!(node_by_id, cube_scan_params[8], CubeScanWrapped); + // TODO filters + // TODO + let mut query = V1LoadRequestQuery::new(); + let mut fields = Vec::new(); + let mut query_measures = Vec::new(); + let mut query_time_dimensions = Vec::new(); + let mut query_order = Vec::new(); + let mut query_dimensions = Vec::new(); + + for m in members { + match m { + LogicalPlanLanguage::Measure(measure_params) => { + let measure = + match_data_node!(node_by_id, measure_params[0], MeasureName); + let expr = self.to_expr(measure_params[1])?; + query_measures.push(measure.to_string()); + let data_type = self + .cube_context + .meta + .find_df_data_type(measure.to_string()) + .ok_or(CubeError::internal(format!( + "Can't find measure '{}'", + measure + )))?; + fields.push(( + DFField::new( + expr_relation(&expr), + &expr_name(&expr)?, + data_type, + true, + ), + MemberField::Member(measure.to_string()), + )); + } + LogicalPlanLanguage::TimeDimension(params) => { + let dimension = + match_data_node!(node_by_id, params[0], TimeDimensionName); + let granularity = + match_data_node!(node_by_id, params[1], TimeDimensionGranularity); + let date_range = + match_data_node!(node_by_id, params[2], TimeDimensionDateRange); + let expr = self.to_expr(params[3])?; + let query_time_dimension = V1LoadRequestQueryTimeDimension { + dimension: dimension.to_string(), + granularity: granularity.clone(), + date_range: date_range.map(|date_range| { + serde_json::Value::Array( + date_range + .into_iter() + .map(|d| serde_json::Value::String(d)) + .collect(), + ) + }), + }; + if !query_time_dimensions.contains(&query_time_dimension) { + query_time_dimensions.push(query_time_dimension); + } + if let Some(granularity) = &granularity { + fields.push(( + DFField::new( + expr_relation(&expr), + // TODO empty schema + &expr_name(&expr)?, + DataType::Timestamp(TimeUnit::Nanosecond, None), + true, + ), + MemberField::Member(format!("{}.{}", dimension, granularity)), + )); + } + } + LogicalPlanLanguage::Dimension(params) => { + let dimension = match_data_node!(node_by_id, params[0], DimensionName); + let expr = self.to_expr(params[1])?; + let data_type = self + .cube_context + .meta + .find_df_data_type(dimension.to_string()) + .ok_or(CubeError::internal(format!( + "Can't find dimension '{}'", + dimension + )))?; + query_dimensions.push(dimension.to_string()); + fields.push(( + DFField::new( + expr_relation(&expr), + // TODO empty schema + &expr_name(&expr)?, + data_type, + true, + ), + MemberField::Member(dimension), + )); + } + LogicalPlanLanguage::Segment(params) => { + let expr = self.to_expr(params[1])?; + fields.push(( + DFField::new( + expr_relation(&expr), + // TODO empty schema + &expr_name(&expr)?, + DataType::Boolean, + true, + ), + MemberField::Literal(ScalarValue::Boolean(None)), + )); + } + LogicalPlanLanguage::ChangeUser(params) => { + let expr = self.to_expr(params[1])?; + fields.push(( + DFField::new( + expr_relation(&expr), + // TODO empty schema + &expr_name(&expr)?, + DataType::Utf8, + true, + ), + MemberField::Literal(ScalarValue::Utf8(None)), + )); + } + LogicalPlanLanguage::LiteralMember(params) => { + let value = match_data_node!(node_by_id, params[0], LiteralMemberValue); + let expr = self.to_expr(params[1])?; + let relation = + match_data_node!(node_by_id, params[2], LiteralMemberRelation); + fields.push(( + DFField::new( + relation.as_deref(), + &expr_name(&expr)?, + value.get_datatype(), + true, + ), + MemberField::Literal(value), + )); + } + LogicalPlanLanguage::VirtualField(params) => { + let expr = self.to_expr(params[2])?; + fields.push(( + DFField::new( + expr_relation(&expr), + // TODO empty schema + &expr_name(&expr)?, + DataType::Utf8, + true, + ), + MemberField::Literal(ScalarValue::Utf8(None)), + )); + } + LogicalPlanLanguage::MemberError(params) => { + let error = match_data_node!(node_by_id, params[0], MemberErrorError); + return Err(CubeError::user(error.to_string())); + } + LogicalPlanLanguage::AllMembers(_) => { + if !wrapped { + return Err(CubeError::internal( + "Can't detect Cube query and it may be not supported yet" + .to_string(), + )); + } else { + for (alias, cube) in alias_to_cube.iter() { + let cube = self .cube_context .meta - .find_df_data_type(dimension.to_string()) - .ok_or(CubeError::internal(format!( - "Can't find dimension '{}'", - dimension - )))?; - query_dimensions.push(dimension.to_string()); - fields.push(( - DFField::new( - expr_relation(&expr), - // TODO empty schema - &expr_name(&expr)?, - data_type, - true, - ), - MemberField::Member(dimension), - )); - } - LogicalPlanLanguage::Segment(params) => { - let expr = self.to_expr(params[1])?; - fields.push(( - DFField::new( - expr_relation(&expr), - // TODO empty schema - &expr_name(&expr)?, - DataType::Boolean, - true, - ), - MemberField::Literal(ScalarValue::Boolean(None)), - )); - } - LogicalPlanLanguage::ChangeUser(params) => { - let expr = self.to_expr(params[1])?; - fields.push(( - DFField::new( - expr_relation(&expr), - // TODO empty schema - &expr_name(&expr)?, - DataType::Utf8, - true, - ), - MemberField::Literal(ScalarValue::Utf8(None)), - )); - } - LogicalPlanLanguage::LiteralMember(params) => { - let value = - match_data_node!(node_by_id, params[0], LiteralMemberValue); - let expr = self.to_expr(params[1])?; - let relation = match_data_node!( - node_by_id, - params[2], - LiteralMemberRelation - ); - fields.push(( - DFField::new( - relation.as_deref(), - &expr_name(&expr)?, - value.get_datatype(), - true, - ), - MemberField::Literal(value), - )); - } - LogicalPlanLanguage::VirtualField(params) => { - let expr = self.to_expr(params[2])?; - fields.push(( - DFField::new( - expr_relation(&expr), - // TODO empty schema - &expr_name(&expr)?, - DataType::Utf8, - true, - ), - MemberField::Literal(ScalarValue::Utf8(None)), - )); - } - LogicalPlanLanguage::MemberError(params) => { - let error = - match_data_node!(node_by_id, params[0], MemberErrorError); - return Err(CubeError::user(error.to_string())); - } - LogicalPlanLanguage::AllMembers(_) => { - if !wrapped { - return Err(CubeError::internal( - "Can't detect Cube query and it may be not supported yet" - .to_string(), - )); - } else { - for (alias, cube) in alias_to_cube.iter() { - let cube = self - .cube_context - .meta - .find_cube_with_name(cube) - .ok_or_else(|| { - CubeError::user(format!( - "Can't find cube '{}'", - cube - )) - })?; - for column in cube.get_columns() { - if self.cube_context.meta.is_synthetic_field( + .find_cube_with_name(cube) + .ok_or_else(|| { + CubeError::user(format!("Can't find cube '{}'", cube)) + })?; + for column in cube.get_columns() { + if self + .cube_context + .meta + .is_synthetic_field(column.member_name().to_string()) + { + fields.push(( + DFField::new( + Some(&alias), + column.get_name(), + column.get_column_type().to_arrow(), + true, + ), + MemberField::Literal(ScalarValue::Utf8(None)), + )); + } else { + fields.push(( + DFField::new( + Some(&alias), + column.get_name(), + column.get_column_type().to_arrow(), + true, + ), + MemberField::Member( column.member_name().to_string(), - ) { - fields.push(( - DFField::new( - Some(&alias), - column.get_name(), - column.get_column_type().to_arrow(), - true, - ), - MemberField::Literal(ScalarValue::Utf8( - None, - )), - )); - } else { - fields.push(( - DFField::new( - Some(&alias), - column.get_name(), - column.get_column_type().to_arrow(), - true, - ), - MemberField::Member( - column.member_name().to_string(), - ), - )); - } - } + ), + )); } } } - x => panic!("Expected dimension but found {:?}", x), } } + x => panic!("Expected dimension but found {:?}", x), + } + } - let filters = - match_list_node!(node_by_id, cube_scan_params[2], CubeScanFilters); + let filters = match_list_node!(node_by_id, cube_scan_params[2], CubeScanFilters); + + fn to_filter( + query_time_dimensions: &mut Vec, + filters: Vec, + node_by_id: &impl Index, + is_in_or: bool, + ) -> Result< + ( + Vec, + Vec, + Option, + ), + CubeError, + > { + let mut result = Vec::new(); + let mut segments_result = Vec::new(); + let mut change_user_result = Vec::new(); + + for f in filters { + match f { + LogicalPlanLanguage::FilterOp(params) => { + let filters = + match_list_node!(node_by_id, params[0], FilterOpFilters); + let op = match_data_node!(node_by_id, params[1], FilterOpOp); + let is_and_op = op == "and"; + let (filters, segments, change_user) = to_filter( + query_time_dimensions, + filters, + node_by_id, + !is_in_or || !is_and_op, + )?; + match op.as_str() { + "and" => { + result.push(V1LoadRequestQueryFilterItem { + member: None, + operator: None, + values: None, + or: None, + and: Some( + filters + .into_iter() + .map(|f| serde_json::json!(f)) + .collect(), + ), + }); + segments_result.extend(segments); - fn to_filter( - query_time_dimensions: &mut Vec, - filters: Vec, - node_by_id: &impl Index, - is_in_or: bool, - ) -> Result< - ( - Vec, - Vec, - Option, - ), - CubeError, - > { - let mut result = Vec::new(); - let mut segments_result = Vec::new(); - let mut change_user_result = Vec::new(); - - for f in filters { - match f { - LogicalPlanLanguage::FilterOp(params) => { - let filters = match_list_node!( - node_by_id, - params[0], - FilterOpFilters - ); - let op = - match_data_node!(node_by_id, params[1], FilterOpOp); - let is_and_op = op == "and"; - let (filters, segments, change_user) = to_filter( - query_time_dimensions, - filters, - node_by_id, - !is_in_or || !is_and_op, - )?; - match op.as_str() { - "and" => { - result.push(V1LoadRequestQueryFilterItem { - member: None, - operator: None, - values: None, - or: None, - and: Some( - filters - .into_iter() - .map(|f| serde_json::json!(f)) - .collect(), - ), - }); - segments_result.extend(segments); - - if change_user.is_some() { - change_user_result.extend(change_user); - } - } - "or" => { - result.push(V1LoadRequestQueryFilterItem { - member: None, - operator: None, - values: None, - or: Some( - filters - .into_iter() - .map(|f| serde_json::json!(f)) - .collect(), - ), - and: None, - }); - if !segments.is_empty() { - return Err(CubeError::internal( - "Can't use OR operator with segments" - .to_string(), - )); - } - - if change_user.is_some() { - return Err(CubeError::internal( - "Can't use OR operator with __user column" - .to_string(), - )); - } - } - x => panic!("Unsupported filter operator: {}", x), + if change_user.is_some() { + change_user_result.extend(change_user); } } - LogicalPlanLanguage::FilterMember(params) => { - let member = match_data_node!( - node_by_id, - params[0], - FilterMemberMember - ); - let op = - match_data_node!(node_by_id, params[1], FilterMemberOp); - let values = match_data_node!( - node_by_id, - params[2], - FilterMemberValues - ); - if !is_in_or && op == "inDateRange" { - let existing_time_dimension = - query_time_dimensions.iter_mut().find_map(|td| { - if td.dimension == member - && td.date_range.is_none() - { - td.date_range = Some(json!(values)); - Some(td) - } else { - None - } - }); - if existing_time_dimension.is_none() { - let dimension = V1LoadRequestQueryTimeDimension { - dimension: member.to_string(), - granularity: None, - date_range: Some(json!(values)), - }; - query_time_dimensions.push(dimension); - } - } else { - result.push(V1LoadRequestQueryFilterItem { - member: Some(member), - operator: Some(op), - values: if !values.is_empty() { - Some(values) - } else { - None - }, - or: None, - and: None, - }); + "or" => { + result.push(V1LoadRequestQueryFilterItem { + member: None, + operator: None, + values: None, + or: Some( + filters + .into_iter() + .map(|f| serde_json::json!(f)) + .collect(), + ), + and: None, + }); + if !segments.is_empty() { + return Err(CubeError::internal( + "Can't use OR operator with segments".to_string(), + )); + } + + if change_user.is_some() { + return Err(CubeError::internal( + "Can't use OR operator with __user column" + .to_string(), + )); } } - LogicalPlanLanguage::SegmentMember(params) => { - let member = match_data_node!( - node_by_id, - params[0], - SegmentMemberMember - ); - segments_result.push(member); - } - LogicalPlanLanguage::ChangeUserMember(params) => { - let member = match_data_node!( - node_by_id, - params[0], - ChangeUserMemberValue - ); - change_user_result.push(member); + x => panic!("Unsupported filter operator: {}", x), + } + } + LogicalPlanLanguage::FilterMember(params) => { + let member = + match_data_node!(node_by_id, params[0], FilterMemberMember); + let op = match_data_node!(node_by_id, params[1], FilterMemberOp); + let values = + match_data_node!(node_by_id, params[2], FilterMemberValues); + if !is_in_or && op == "inDateRange" { + let existing_time_dimension = + query_time_dimensions.iter_mut().find_map(|td| { + if td.dimension == member && td.date_range.is_none() { + td.date_range = Some(json!(values)); + Some(td) + } else { + None + } + }); + if existing_time_dimension.is_none() { + let dimension = V1LoadRequestQueryTimeDimension { + dimension: member.to_string(), + granularity: None, + date_range: Some(json!(values)), + }; + query_time_dimensions.push(dimension); } - x => panic!("Expected filter but found {:?}", x), + } else { + result.push(V1LoadRequestQueryFilterItem { + member: Some(member), + operator: Some(op), + values: if !values.is_empty() { + Some(values) + } else { + None + }, + or: None, + and: None, + }); } } - - if change_user_result.len() > 1 { - return Err(CubeError::internal( - "Unable to use multiple __user in one Cube query".to_string(), - )); + LogicalPlanLanguage::SegmentMember(params) => { + let member = + match_data_node!(node_by_id, params[0], SegmentMemberMember); + segments_result.push(member); } - - Ok((result, segments_result, change_user_result.pop())) + LogicalPlanLanguage::ChangeUserMember(params) => { + let member = + match_data_node!(node_by_id, params[0], ChangeUserMemberValue); + change_user_result.push(member); + } + x => panic!("Expected filter but found {:?}", x), } + } - let (filters, segments, change_user) = - to_filter(&mut query_time_dimensions, filters, node_by_id, false)?; + if change_user_result.len() > 1 { + return Err(CubeError::internal( + "Unable to use multiple __user in one Cube query".to_string(), + )); + } - query.filters = if filters.len() > 0 { - Some(filters) - } else { - None - }; - - query.segments = Some(segments); - - for o in order { - let order_params = match_params!(o, Order); - let order_member = - match_data_node!(node_by_id, order_params[0], OrderMember); - let order_asc = match_data_node!(node_by_id, order_params[1], OrderAsc); - query_order.push(vec![ - order_member, - if order_asc { - "asc".to_string() - } else { - "desc".to_string() - }, - ]) - } + Ok((result, segments_result, change_user_result.pop())) + } - if !wrapped && fields.len() == 0 { - return Err(CubeError::internal( - "Can't detect Cube query and it may be not supported yet" - .to_string(), - )); - } + let (filters, segments, change_user) = + to_filter(&mut query_time_dimensions, filters, node_by_id, false)?; + + query.filters = if filters.len() > 0 { + Some(filters) + } else { + None + }; - query.measures = Some(query_measures.into_iter().unique().collect()); - query.dimensions = Some(query_dimensions.into_iter().unique().collect()); - query.time_dimensions = if query_time_dimensions.len() > 0 { - Some( - query_time_dimensions - .into_iter() - .unique_by(|td| { - ( - td.dimension.to_string(), - td.granularity.clone(), - td.date_range - .as_ref() - .map(|range| serde_json::to_string(range).unwrap()), - ) - }) - .collect(), - ) + query.segments = Some(segments); + + for o in order { + let order_params = match_params!(o, Order); + let order_member = match_data_node!(node_by_id, order_params[0], OrderMember); + let order_asc = match_data_node!(node_by_id, order_params[1], OrderAsc); + query_order.push(vec![ + order_member, + if order_asc { + "asc".to_string() } else { - None - }; - - let cube_scan_query_limit = self - .cube_context - .sessions - .server - .config_obj - .non_streaming_query_max_row_limit() - as usize; - let fail_on_max_limit_hit = env::var("CUBESQL_FAIL_ON_MAX_LIMIT_HIT") - .map(|v| v.to_lowercase() == "true") - .unwrap_or(false); - let mut limit_was_changed = false; - query.limit = match match_data_node!( - node_by_id, - cube_scan_params[4], - CubeScanLimit - ) { - Some(n) => { - if n > cube_scan_query_limit { - limit_was_changed = true; - } - Some(n) + "desc".to_string() + }, + ]) + } + + if !wrapped && fields.len() == 0 { + return Err(CubeError::internal( + "Can't detect Cube query and it may be not supported yet".to_string(), + )); + } + + query.measures = Some(query_measures.into_iter().unique().collect()); + query.dimensions = Some(query_dimensions.into_iter().unique().collect()); + query.time_dimensions = if query_time_dimensions.len() > 0 { + Some( + query_time_dimensions + .into_iter() + .unique_by(|td| { + ( + td.dimension.to_string(), + td.granularity.clone(), + td.date_range + .as_ref() + .map(|range| serde_json::to_string(range).unwrap()), + ) + }) + .collect(), + ) + } else { + None + }; + + let cube_scan_query_limit = + self.cube_context + .sessions + .server + .config_obj + .non_streaming_query_max_row_limit() as usize; + let fail_on_max_limit_hit = env::var("CUBESQL_FAIL_ON_MAX_LIMIT_HIT") + .map(|v| v.to_lowercase() == "true") + .unwrap_or(false); + let mut limit_was_changed = false; + query.limit = + match match_data_node!(node_by_id, cube_scan_params[4], CubeScanLimit) { + Some(n) => { + if n > cube_scan_query_limit { + limit_was_changed = true; } - None => { - if fail_on_max_limit_hit { - limit_was_changed = true; - Some(cube_scan_query_limit) - } else { - None - } + Some(n) + } + None => { + if fail_on_max_limit_hit { + limit_was_changed = true; + Some(cube_scan_query_limit) + } else { + None } } - .map(|n| n as i32); + } + .map(|n| n as i32); - let max_records = if fail_on_max_limit_hit && limit_was_changed { - Some(cube_scan_query_limit) - } else { - None - }; - - let offset = - match_data_node!(node_by_id, cube_scan_params[5], CubeScanOffset) - .map(|offset| offset as i32); - if offset.is_some() { - query.offset = offset; - } + let max_records = if fail_on_max_limit_hit && limit_was_changed { + Some(cube_scan_query_limit) + } else { + None + }; - fields = fields - .into_iter() - .unique_by(|(f, _)| f.qualified_name()) - .collect(); + let offset = match_data_node!(node_by_id, cube_scan_params[5], CubeScanOffset) + .map(|offset| offset as i32); + if offset.is_some() { + query.offset = offset; + } - let ungrouped = - match_data_node!(node_by_id, cube_scan_params[9], CubeScanUngrouped); + fields = fields + .into_iter() + .unique_by(|(f, _)| f.qualified_name()) + .collect(); - if ungrouped { - query.ungrouped = Some(true); - } + let ungrouped = + match_data_node!(node_by_id, cube_scan_params[9], CubeScanUngrouped); - query.order = if !query_order.is_empty() { - Some(query_order) - } else { - // If no order was specified in client SQL, - // there should be no order implicitly added. - // in case when CUBESQL_SQL_NO_IMPLICIT_ORDER it is set to true - no implicit order is - // added for all queries. - // We need to return empty array so the processing in - // BaseQuery.js won't automatically add default order - - let cube_no_implicit_order = self - .cube_context - .sessions - .server - .config_obj - .no_implicit_order(); + if ungrouped { + query.ungrouped = Some(true); + } - if cube_no_implicit_order || query.ungrouped == Some(true) { - Some(vec![]) - } else { - None - } - }; - - let member_fields = fields.iter().map(|(_, m)| m.clone()).collect(); - - Arc::new(CubeScanNode::new( - Arc::new(DFSchema::new_with_metadata( - fields.into_iter().map(|(f, _)| f).collect(), - HashMap::new(), - )?), - member_fields, - query, - self.auth_context.clone(), - CubeScanOptions { - change_user, - max_records, - }, - alias_to_cube.into_iter().map(|(_, c)| c).unique().collect(), - self.span_id.clone(), - )) + query.order = if !query_order.is_empty() { + Some(query_order) + } else { + // If no order was specified in client SQL, + // there should be no order implicitly added. + // in case when CUBESQL_SQL_NO_IMPLICIT_ORDER it is set to true - no implicit order is + // added for all queries. + // We need to return empty array so the processing in + // BaseQuery.js won't automatically add default order + + let cube_no_implicit_order = self + .cube_context + .sessions + .server + .config_obj + .no_implicit_order(); + + if cube_no_implicit_order || query.ungrouped == Some(true) { + Some(vec![]) + } else { + None } - x => panic!("Unexpected extension node: {:?}", x), }; + let member_fields = fields.iter().map(|(_, m)| m.clone()).collect(); + + let node = Arc::new(CubeScanNode::new( + Arc::new(DFSchema::new_with_metadata( + fields.into_iter().map(|(f, _)| f).collect(), + HashMap::new(), + )?), + member_fields, + query, + self.auth_context.clone(), + CubeScanOptions { + change_user, + max_records, + }, + alias_to_cube.into_iter().map(|(_, c)| c).unique().collect(), + self.span_id.clone(), + )); + LogicalPlan::Extension(Extension { node }) } LogicalPlanLanguage::CubeScanWrapper(params) => { @@ -2349,11 +2290,9 @@ impl LanguageToLogicalPlanConverter { fn is_cube_scan_node(&self, node_id: Id) -> bool { let node_by_id = &self.best_expr; match node_by_id.index(node_id) { - LogicalPlanLanguage::Extension(params) => match node_by_id.index(params[0]) { - LogicalPlanLanguage::CubeScan(_) => return true, - _ => (), - }, - LogicalPlanLanguage::CubeScanWrapper(_) => return true, + LogicalPlanLanguage::CubeScan(_) | LogicalPlanLanguage::CubeScanWrapper(_) => { + return true + } _ => (), } diff --git a/rust/cubesql/cubesql/src/compile/rewrite/mod.rs b/rust/cubesql/cubesql/src/compile/rewrite/mod.rs index 7b67cc2042bd6..5473a4548f29a 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/mod.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/mod.rs @@ -2101,7 +2101,7 @@ fn cube_scan( ungrouped: impl Display, ) -> String { format!( - "(Extension (CubeScan {} {} {} {} {} {} {} {} {} {}))", + "(CubeScan {} {} {} {} {} {} {} {} {} {})", alias_to_cube, members, filters, From 3ca3811ab9675567ac0655301dae1294082d5867 Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Fri, 6 Dec 2024 15:51:23 +0200 Subject: [PATCH 10/11] refactor(cubesql): Improve EGraph debugger, part 3: parsing and data preparation in UI side (#8934) * Implement input data parsing in debugger * Use simpler state as debug data source * Enable serde for egg Used just for Id for now * Move data preparation to UI side of debugger * Filter duplicate edges during preparation * Filter non-canonical eclasses before rendering --- packages/cubejs-backend-native/Cargo.lock | 14 ++ rust/cubenativeutils/Cargo.lock | 14 ++ rust/cubesql/Cargo.lock | 14 ++ rust/cubesql/cubesql/Cargo.toml | 2 +- .../egraph-debug-template/package.json | 3 +- .../egraph-debug-template/src/index.tsx | 202 ++++++++++++++++-- .../cubesql/src/compile/rewrite/analysis.rs | 12 +- .../cubesql/src/compile/rewrite/rewriter.rs | 198 ++++++----------- rust/cubesqlplanner/Cargo.lock | 14 ++ 9 files changed, 319 insertions(+), 154 deletions(-) diff --git a/packages/cubejs-backend-native/Cargo.lock b/packages/cubejs-backend-native/Cargo.lock index 5eb487efaf687..1ec0fc189e2b5 100644 --- a/packages/cubejs-backend-native/Cargo.lock +++ b/packages/cubejs-backend-native/Cargo.lock @@ -988,10 +988,12 @@ dependencies = [ "num-bigint", "num-traits", "saturating", + "serde", "smallvec", "symbol_table", "symbolic_expressions", "thiserror", + "vectorize", ] [[package]] @@ -1304,6 +1306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.8", + "serde", ] [[package]] @@ -1523,6 +1526,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -3113,6 +3117,7 @@ checksum = "32bf088d1d7df2b2b6711b06da3471bc86677383c57b27251e18c56df8deac14" dependencies = [ "ahash 0.7.8", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -3661,6 +3666,15 @@ dependencies = [ "serde", ] +[[package]] +name = "vectorize" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e3bbfdfdcc4ea60ce183b1b45c936aacd69fe097ebf137984a32faf80e365b" +dependencies = [ + "serde", +] + [[package]] name = "version_check" version = "0.9.4" diff --git a/rust/cubenativeutils/Cargo.lock b/rust/cubenativeutils/Cargo.lock index 8e60af93afa27..0959a0f2888e6 100644 --- a/rust/cubenativeutils/Cargo.lock +++ b/rust/cubenativeutils/Cargo.lock @@ -854,10 +854,12 @@ dependencies = [ "num-bigint", "num-traits", "saturating", + "serde", "smallvec", "symbol_table", "symbolic_expressions", "thiserror", + "vectorize", ] [[package]] @@ -1152,6 +1154,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.8", + "serde", ] [[package]] @@ -1363,6 +1366,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -2783,6 +2787,7 @@ checksum = "32bf088d1d7df2b2b6711b06da3471bc86677383c57b27251e18c56df8deac14" dependencies = [ "ahash 0.7.8", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -3242,6 +3247,15 @@ dependencies = [ "serde", ] +[[package]] +name = "vectorize" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e3bbfdfdcc4ea60ce183b1b45c936aacd69fe097ebf137984a32faf80e365b" +dependencies = [ + "serde", +] + [[package]] name = "version_check" version = "0.9.4" diff --git a/rust/cubesql/Cargo.lock b/rust/cubesql/Cargo.lock index 58b0377de0dd2..1cb06b84594cd 100644 --- a/rust/cubesql/Cargo.lock +++ b/rust/cubesql/Cargo.lock @@ -1002,10 +1002,12 @@ dependencies = [ "num-bigint", "num-traits", "saturating", + "serde", "smallvec", "symbol_table", "symbolic_expressions", "thiserror", + "vectorize", ] [[package]] @@ -1284,6 +1286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" dependencies = [ "ahash 0.7.8", + "serde", ] [[package]] @@ -1500,6 +1503,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.1", + "serde", ] [[package]] @@ -2945,6 +2949,7 @@ checksum = "32bf088d1d7df2b2b6711b06da3471bc86677383c57b27251e18c56df8deac14" dependencies = [ "ahash 0.7.8", "hashbrown 0.12.1", + "serde", ] [[package]] @@ -3428,6 +3433,15 @@ dependencies = [ "serde", ] +[[package]] +name = "vectorize" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e3bbfdfdcc4ea60ce183b1b45c936aacd69fe097ebf137984a32faf80e365b" +dependencies = [ + "serde", +] + [[package]] name = "version_check" version = "0.9.4" diff --git a/rust/cubesql/cubesql/Cargo.toml b/rust/cubesql/cubesql/Cargo.toml index 60c6d5284eafd..dc996a11726c6 100644 --- a/rust/cubesql/cubesql/Cargo.toml +++ b/rust/cubesql/cubesql/Cargo.toml @@ -45,7 +45,7 @@ mockall = "0.8.1" tokio-util = { version = "0.7", features=["compat"] } comfy-table = "7.1.0" bitflags = "1.3.2" -egg = { rev = "952f8c2a1033e5da097d23c523b0d8e392eb532b", git = "https://github.com/cube-js/egg.git" } +egg = { rev = "952f8c2a1033e5da097d23c523b0d8e392eb532b", git = "https://github.com/cube-js/egg.git", features = ["serde-1"] } paste = "1.0.6" csv = "1.1.6" tracing = { version = "0.1.40", features = ["async-await"] } diff --git a/rust/cubesql/cubesql/egraph-debug-template/package.json b/rust/cubesql/cubesql/egraph-debug-template/package.json index 60c0f901087df..f01a8fcd10356 100644 --- a/rust/cubesql/cubesql/egraph-debug-template/package.json +++ b/rust/cubesql/cubesql/egraph-debug-template/package.json @@ -6,7 +6,8 @@ "elkjs": "^0.9.1", "react": "18.1.0", "react-dom": "18.1.0", - "reactflow": "^11.10.3" + "reactflow": "^11.10.3", + "zod": "3.23.8" }, "scripts": { "start": "GENERATE_SOURCEMAP=false && react-scripts start", diff --git a/rust/cubesql/cubesql/egraph-debug-template/src/index.tsx b/rust/cubesql/cubesql/egraph-debug-template/src/index.tsx index 641a25369371c..29717ea340dcc 100644 --- a/rust/cubesql/cubesql/egraph-debug-template/src/index.tsx +++ b/rust/cubesql/cubesql/egraph-debug-template/src/index.tsx @@ -18,6 +18,7 @@ import type { NodeProps, } from 'reactflow'; import 'reactflow/dist/style.css'; +import { z } from 'zod'; import statesData from './states.json'; @@ -26,15 +27,37 @@ type InputNodeData = { label: string; comboId: string; }; + type InputEdgeData = { source: string; target: string; }; + type InputComboData = { id: string; label: string; }; -type StateData = { + +const EClassDebugData = z.object({ + id: z.number(), + canon: z.number(), +}); +type EClassDebugData = z.infer; + +const ENodeDebugData = z.object({ + enode: z.string(), + eclass: z.number(), + children: z.array(z.number()), +}); +type ENodeDebugData = z.infer; + +const EGraphDebugState = z.object({ + eclasses: z.array(EClassDebugData), + enodes: z.array(ENodeDebugData), +}); +type EGraphDebugState = z.infer; + +type PreparedStateData = { nodes: Array; removedNodes: Array; edges: Array; @@ -43,7 +66,15 @@ type StateData = { removedCombos: Array; appliedRules: Array; }; -type InputData = Array; + +const StateData = z.object({ + egraph: EGraphDebugState, + appliedRules: z.array(z.string()), +}); +type StateData = z.infer; + +const InputData = z.array(StateData); +type InputData = z.infer; type NodeData = { label: string; @@ -51,15 +82,158 @@ type NodeData = { type Node = ReactFlowNode; type Edge = ReactFlowEdge; -// TODO proper parsing here -const states = statesData as InputData; +const states: InputData = InputData.parse(statesData); + +function prepareStates(states: InputData): Array { + const result = []; + let previousDebugData: + | { + nodes: Array; + edges: Array; + combos: Array; + } + | undefined; + + for (const { egraph, appliedRules } of states) { + let nodes = egraph.enodes + .map((node) => { + return { + id: `${node.eclass}-${node.enode}`, + label: node.enode, + comboId: `c${node.eclass}`, + } as InputNodeData; + }) + .concat( + egraph.eclasses + // render only canonical eclasses to avoid rendering empty nodes and combos for merged ones + .filter((eclass) => eclass.id === eclass.canon) + .map((eclass) => { + return { + id: eclass.id.toString(), + label: eclass.id.toString(), + comboId: `c${eclass.id}`, + } as InputNodeData; + }), + ); + + const allEdges = egraph.enodes + .map((node) => { + return { + source: node.eclass.toString(), + target: `${node.eclass}-${node.enode}`, + } as InputEdgeData; + }) + .concat( + egraph.enodes.flatMap((node) => { + return node.children.map((child) => { + return { + source: `${node.eclass}-${node.enode}`, + target: child.toString(), + }; + }); + }), + ); + // Same eclass can be present as child for a single enode multiple times + // E.g. CubeScanFilters([CubeScanFilters([]), CubeScanFilters([])]) + // Both internal nodes are same eclass + // This will lead to duplicated edges and non-uniq ids + const uniqueEdges = new Map(); + for (const edge of allEdges) { + const key = JSON.stringify(edge); + if (uniqueEdges.get(key)) { + continue; + } + uniqueEdges.set(key, edge); + } + let edges = [...uniqueEdges.values()]; + + let combos = egraph.eclasses + // render only canonical eclasses to avoid rendering empty nodes and combos for merged ones + .filter((eclass) => eclass.id === eclass.canon) + .map((eclass) => { + return { + id: `c${eclass.id}`, + label: `#${eclass.id}`, + } as InputComboData; + }); + + const nodesClone = nodes.slice(); + const edgesClone = edges.slice(); + const combosClone = combos.slice(); + + let removedNodes: Array = []; + let removedEdges: Array = []; + let removedCombos: Array = []; + + if (previousDebugData !== undefined) { + const { + nodes: prevNodes, + edges: prevEdges, + combos: prevCombos, + } = previousDebugData; + nodes = nodes.filter( + (n) => !prevNodes.some((ln) => ln.id === n.id), + ); + edges = edges.filter( + (n) => + !prevEdges.some( + (ln) => + ln.source === n.source && ln.target === n.target, + ), + ); + combos = combos.filter( + (n) => !prevCombos.some((ln) => ln.id === n.id), + ); + + removedNodes = prevNodes.slice(); + removedNodes = removedNodes.filter( + (n) => !nodesClone.some((ln) => ln.id === n.id), + ); + + removedEdges = prevEdges.slice(); + removedEdges = removedEdges.filter( + (n) => + !edgesClone.some( + (ln) => + ln.source === n.source && ln.target === n.target, + ), + ); + + removedCombos = prevCombos.slice(); + removedCombos = removedCombos.filter( + (n) => !combosClone.some((ln) => ln.id === n.id), + ); + } + + let debugData = { + nodes, + edges, + combos, + removedNodes, + removedEdges, + removedCombos, + appliedRules, + } as PreparedStateData; + + result.push(debugData); + previousDebugData = { + nodes: nodesClone, + edges: edgesClone, + combos: combosClone, + }; + } + + return result; +} + +let preparedStates = prepareStates(states); // First is initial state -const totalIterations = states.length - 1; +const totalIterations = preparedStates.length - 1; const data = { - nodes: states[0].nodes, - edges: states[0].edges, - combos: states[0].combos, + nodes: preparedStates[0].nodes, + edges: preparedStates[0].edges, + combos: preparedStates[0].combos, }; const sizeByNode = (n: InputNodeData): [number, number] => [ 60 + n.label.length * 5, @@ -400,7 +574,7 @@ const LayoutFlow = () => { } let newNodes = preNodes; let newEdges = preEdges; - const toRemove = states[stateIdx]; + const toRemove = preparedStates[stateIdx]; let toRemoveNodeIds = (toRemove.nodes as Array<{ id: string }>) .concat(toRemove.combos) .map((n) => n.id); @@ -419,7 +593,7 @@ const LayoutFlow = () => { newEdges = newEdges.concat( Object.keys(edgeMap).map((key) => edgeMap[key]), ); - const toHighlight = states[stateIdx - 1]; + const toHighlight = preparedStates[stateIdx - 1]; const toHighlightNodeIds = (toHighlight.nodes as Array<{ id: string }>) .concat(toHighlight.combos) .map((n) => n.id); @@ -437,13 +611,13 @@ const LayoutFlow = () => { }; const nextState = () => { - if (stateIdx === states.length - 1) { + if (stateIdx === preparedStates.length - 1) { return; } let newNodes = preNodes; let newEdges = preEdges; setStateIdx(stateIdx + 1); - const toAdd = states[stateIdx + 1]; + const toAdd = preparedStates[stateIdx + 1]; let toRemoveNodeIds = (toAdd.removedNodes as Array<{ id: string }>) .concat(toAdd.removedCombos) .map((n) => n.id); @@ -581,7 +755,9 @@ const LayoutFlow = () => { ))}
- {states[stateIdx].appliedRules.join(', ')} + + {preparedStates[stateIdx].appliedRules.join(', ')} +
diff --git a/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs b/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs index f0af8e3396fa3..a5df8018f19e4 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/analysis.rs @@ -3,7 +3,7 @@ use crate::{ rewrite::{ converter::{is_expr_node, node_to_expr, LogicalPlanToLanguageConverter}, expr_column_name, - rewriter::{CubeEGraph, DebugData}, + rewriter::{CubeEGraph, EGraphDebugState}, AggregateUDFExprFun, AliasExprAlias, AllMembersAlias, AllMembersCube, ChangeUserCube, ColumnExprColumn, DimensionName, FilterMemberMember, FilterMemberOp, LiteralExprValue, LiteralMemberRelation, LiteralMemberValue, LogicalPlanLanguage, MeasureName, @@ -235,8 +235,6 @@ impl Member { } } -type EgraphDebugState = DebugData; - #[derive(Clone)] pub struct LogicalPlanAnalysis { /* This is 0, when creating the EGraph. It's set to 1 before iteration 0, @@ -244,7 +242,7 @@ pub struct LogicalPlanAnalysis { pub iteration_timestamp: usize, /// Debug info, used with egraph-debug /// Will be filled by special hook in Runner - pub debug_states: Vec, + pub debug_states: Vec, cube_context: Arc, planner: Arc, } @@ -283,16 +281,12 @@ impl LogicalPlanAnalysis { } } - fn prepare_egraph_debug_state(egraph: &CubeEGraph) -> EgraphDebugState { - DebugData::prepare(egraph) - } - pub fn store_egraph_debug_state(egraph: &mut CubeEGraph) { debug_assert_eq!( egraph.analysis.iteration_timestamp, egraph.analysis.debug_states.len() ); - let state = Self::prepare_egraph_debug_state(egraph); + let state = EGraphDebugState::new(egraph); egraph.analysis.debug_states.push(state); } diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs index bb7840374fae4..02f299617be70 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs @@ -42,101 +42,76 @@ pub struct Rewriter { pub type CubeRunner = Runner; -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DebugNode { - id: String, - label: String, - #[serde(rename = "comboId")] - combo_id: String, +#[derive(Clone, Serialize, Deserialize)] +struct DebugENodeId(String); + +impl From<&LogicalPlanLanguage> for DebugENodeId { + fn from(value: &LogicalPlanLanguage) -> Self { + Self(format!("{value:?}")) + } } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DebugEdge { - source: String, - target: String, +#[derive(Clone, Serialize, Deserialize)] +pub struct EClassDebugData { + id: Id, + canon: Id, } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DebugCombo { - id: String, - label: String, +#[derive(Clone, Serialize, Deserialize)] +pub struct ENodeDebugData { + enode: DebugENodeId, + eclass: Id, + children: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DebugData { - nodes: Vec, - #[serde(rename = "removedNodes")] - removed_nodes: Vec, - edges: Vec, - #[serde(rename = "removedEdges")] - removed_edges: Vec, - combos: Vec, - #[serde(rename = "removedCombos")] - removed_combos: Vec, - #[serde(rename = "appliedRules")] - applied_rules: Option>, +/// Representation is optimised for storing in JSON, to transfer to UI +#[derive(Clone, Serialize, Deserialize)] +pub struct EGraphDebugState { + eclasses: Vec, + enodes: Vec, } -impl DebugData { - pub fn prepare(graph: &CubeEGraph) -> DebugData { - DebugData { - applied_rules: None, - nodes: graph - .classes() - .flat_map(|class| { - let mut result = class - .nodes - .iter() - .map(|n| { - let node_id = format!("{}-{:?}", class.id, n); - DebugNode { - id: node_id.to_string(), - label: format!("{:?}", n), - combo_id: format!("c{}", class.id), - } - }) - .collect::>(); - result.push(DebugNode { - id: class.id.to_string(), - label: class.id.to_string(), - combo_id: format!("c{}", class.id), - }); - result - }) - .collect(), - edges: graph - .classes() - .flat_map(|class| { - class - .nodes - .iter() - .map(|n| DebugEdge { - source: class.id.to_string(), - target: format!("{}-{:?}", class.id, n,), - }) - .chain(class.nodes.iter().flat_map(|n| { - n.children().iter().map(move |c| DebugEdge { - source: format!("{}-{:?}", class.id, n), - target: c.to_string(), - }) - })) - .collect::>() - }) - .collect(), - combos: graph - .classes() - .map(|class| DebugCombo { - id: format!("c{}", class.id), - label: format!("#{}", class.id), - }) - .collect(), - removed_nodes: Vec::new(), - removed_edges: Vec::new(), - removed_combos: Vec::new(), - } +impl EGraphDebugState { + pub fn new(graph: &EGraph) -> Self { + let current_eclasses = graph.classes().map(|ec| ec.id); + let previous_debug_eclasses = graph + .analysis + .debug_states + .iter() + .flat_map(|state| state.eclasses.iter().map(|ecd| ecd.id)); + let all_known_eclasses = current_eclasses.chain(previous_debug_eclasses); + + let all_known_eclasses = all_known_eclasses.collect::>(); + + let eclasses = all_known_eclasses + .into_iter() + .map(|ec| EClassDebugData { + id: ec, + canon: graph.find(ec), + }) + .collect::>(); + + let enodes = graph + .classes() + .flat_map(|ec| ec.nodes.iter().map(move |node| (ec.id, node))) + .map(|(ec, node)| ENodeDebugData { + enode: node.into(), + eclass: ec, + children: node.children().to_vec(), + }) + .collect(); + + EGraphDebugState { eclasses, enodes } } } +#[derive(Serialize, Deserialize)] +struct DebugState { + egraph: EGraphDebugState, + #[serde(rename = "appliedRules")] + applied_rules: Vec, +} + #[derive(Debug)] pub struct IterInfo { debug_qtrace_eclasses: Option>, @@ -190,9 +165,6 @@ fn write_debug_states(runner: &CubeRunner, stage: &str) -> Result<(), CubeError> format!("{}/src/index.tsx", dir), )?; - let mut states = Vec::new(); - let mut last_debug_data: Option = None; - let debug_data = runner.egraph.analysis.debug_states.as_slice(); debug_assert_eq!(debug_data.len(), runner.iterations.len() + 1); @@ -202,53 +174,19 @@ fn write_debug_states(runner: &CubeRunner, stage: &str) -> Result<(), CubeError> .iter() .skip(1) .zip(runner.iterations.iter().map(|i| Some(&i.applied))); - let states_data = std::iter::once((&debug_data[0], None)).chain(states_data); - - for (debug_data, applied) in states_data { - let mut debug_data = debug_data.clone(); - let debug_data_clone = debug_data.clone(); - - if let Some(last) = last_debug_data { - debug_data - .nodes - .retain(|n| !last.nodes.iter().any(|ln| ln.id == n.id)); - debug_data.edges.retain(|n| { - !last - .edges - .iter() - .any(|ln| ln.source == n.source && ln.target == n.target) - }); - debug_data - .combos - .retain(|n| !last.combos.iter().any(|ln| ln.id == n.id)); - - debug_data.removed_nodes = last.nodes.clone(); - debug_data - .removed_nodes - .retain(|n| !debug_data_clone.nodes.iter().any(|ln| ln.id == n.id)); - debug_data.removed_edges = last.edges.clone(); - debug_data.removed_edges.retain(|n| { - !debug_data_clone - .edges - .iter() - .any(|ln| ln.source == n.source && ln.target == n.target) - }); - debug_data.removed_combos = last.combos.clone(); - debug_data - .removed_combos - .retain(|n| !debug_data_clone.combos.iter().any(|ln| ln.id == n.id)); - } - debug_data.applied_rules = Some( - applied + let debug_data = std::iter::once((&debug_data[0], None)) + .chain(states_data) + .map(|(egraph, applied_rules)| DebugState { + egraph: egraph.clone(), + applied_rules: applied_rules .map(|applied| applied.iter().map(|s| format!("{:?}", s)).collect()) .unwrap_or(vec![]), - ); - states.push(debug_data); - last_debug_data = Some(debug_data_clone); - } + }) + .collect::>(); + fs::write( format!("{}/src/states.json", dir), - serde_json::to_string_pretty(&states)?, + serde_json::to_string_pretty(&debug_data)?, )?; Ok(()) diff --git a/rust/cubesqlplanner/Cargo.lock b/rust/cubesqlplanner/Cargo.lock index 834e1ed12c0ff..55b1401878539 100644 --- a/rust/cubesqlplanner/Cargo.lock +++ b/rust/cubesqlplanner/Cargo.lock @@ -908,10 +908,12 @@ dependencies = [ "num-bigint", "num-traits", "saturating", + "serde", "smallvec", "symbol_table", "symbolic_expressions", "thiserror", + "vectorize", ] [[package]] @@ -1206,6 +1208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.8", + "serde", ] [[package]] @@ -1417,6 +1420,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -2850,6 +2854,7 @@ checksum = "32bf088d1d7df2b2b6711b06da3471bc86677383c57b27251e18c56df8deac14" dependencies = [ "ahash 0.7.8", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -3309,6 +3314,15 @@ dependencies = [ "serde", ] +[[package]] +name = "vectorize" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e3bbfdfdcc4ea60ce183b1b45c936aacd69fe097ebf137984a32faf80e365b" +dependencies = [ + "serde", +] + [[package]] name = "version_check" version = "0.9.4" From a74818eece759e350c3a82d574e5106801fe4627 Mon Sep 17 00:00:00 2001 From: Mikhail Cheshkov Date: Fri, 6 Dec 2024 17:11:31 +0200 Subject: [PATCH 11/11] refactor(cubestore): Use OnceLock for GLOBAL_SINK (#9023) --- rust/cubestore/cubestore/src/util/metrics.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/rust/cubestore/cubestore/src/util/metrics.rs b/rust/cubestore/cubestore/src/util/metrics.rs index c53fb8adfd960..66cbbdf5705c7 100644 --- a/rust/cubestore/cubestore/src/util/metrics.rs +++ b/rust/cubestore/cubestore/src/util/metrics.rs @@ -17,7 +17,6 @@ use crate::CubeError; use std::net::ToSocketAddrs; use std::net::UdpSocket; -use std::sync::Once; #[derive(Debug, PartialEq, Eq)] pub enum Compatibility { @@ -189,8 +188,9 @@ impl Sink { mod global_sink { use super::*; - static mut GLOBAL_SINK: Option = None; - static ONCE: Once = Once::new(); + use std::sync::OnceLock; + + static GLOBAL_SINK: OnceLock> = OnceLock::new(); pub fn init( bind_addr: impl ToSocketAddrs, @@ -201,11 +201,9 @@ mod global_sink { let s = Sink::connect(bind_addr, server_addr, mode, constant_tags)?; let mut called = false; - ONCE.call_once(|| { - unsafe { - GLOBAL_SINK = Some(s); - } + GLOBAL_SINK.get_or_init(|| { called = true; + Some(s) }); if !called { panic!("Metrics initialized twice or used before initialization"); @@ -214,9 +212,7 @@ mod global_sink { } pub(super) fn sink() -> &'static Option { - // Ensure we synchronize access to GLOBAL_SINK. - ONCE.call_once(|| {}); - unsafe { &GLOBAL_SINK } + GLOBAL_SINK.get_or_init(|| None) } }