From 53a75b81ca891d9e975e065f52c44ffdda3ce951 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:04:08 +0200 Subject: [PATCH 01/10] Upgrade rust 1.84.1 -> 1.90.0 (stable) --- .github/workflows/drivers-tests.yml | 2 +- .github/workflows/master.yml | 2 +- .github/workflows/post-release.yml | 2 +- .github/workflows/publish.yml | 8 ++++---- .github/workflows/push.yml | 8 ++++---- .github/workflows/rust-cubesql.yml | 8 ++++---- packages/cubejs-backend-native/rust-toolchain.toml | 2 +- rust/cubenativeutils/rust-toolchain.toml | 2 +- rust/cubeorchestrator/rust-toolchain.toml | 2 +- rust/cubeshared/rust-toolchain.toml | 2 +- rust/cubesql/CLAUDE.md | 2 +- rust/cubesql/rust-toolchain.toml | 2 +- rust/cubesqlplanner/rust-toolchain.toml | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/drivers-tests.yml b/.github/workflows/drivers-tests.yml index 46aa441c976f9..a125e7edae006 100644 --- a/.github/workflows/drivers-tests.yml +++ b/.github/workflows/drivers-tests.yml @@ -111,7 +111,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 3e654726528dc..910b829bece26 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -56,7 +56,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 61ede4f778ae0..13663db586b1f 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -35,7 +35,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 72915644b357e..90e7d7b559748 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -96,7 +96,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -186,7 +186,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -261,7 +261,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4d97bd72d4f2f..a5c4790b8d037 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -148,7 +148,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -213,7 +213,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 components: rustfmt - name: Cargo test cubeorchestrator run: cargo test --manifest-path rust/cubeorchestrator/Cargo.toml -j 4 @@ -276,7 +276,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -424,7 +424,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 8c84fe30ba79f..967de2813004a 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -32,7 +32,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt, clippy @@ -149,7 +149,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -255,7 +255,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt @@ -338,7 +338,7 @@ jobs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.84.1 + toolchain: 1.90.0 # override: true # this is by default on rustflags: "" components: rustfmt diff --git a/packages/cubejs-backend-native/rust-toolchain.toml b/packages/cubejs-backend-native/rust-toolchain.toml index d9f5179de3d93..206200db71083 100644 --- a/packages/cubejs-backend-native/rust-toolchain.toml +++ b/packages/cubejs-backend-native/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubenativeutils/rust-toolchain.toml b/rust/cubenativeutils/rust-toolchain.toml index 8237034eda99e..01c529b889912 100644 --- a/rust/cubenativeutils/rust-toolchain.toml +++ b/rust/cubenativeutils/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "rustc-dev", "clippy"] profile = "minimal" diff --git a/rust/cubeorchestrator/rust-toolchain.toml b/rust/cubeorchestrator/rust-toolchain.toml index d9f5179de3d93..206200db71083 100644 --- a/rust/cubeorchestrator/rust-toolchain.toml +++ b/rust/cubeorchestrator/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubeshared/rust-toolchain.toml b/rust/cubeshared/rust-toolchain.toml index d9f5179de3d93..206200db71083 100644 --- a/rust/cubeshared/rust-toolchain.toml +++ b/rust/cubeshared/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubesql/CLAUDE.md b/rust/cubesql/CLAUDE.md index 759869ca9334f..9b220d2adfa1f 100644 --- a/rust/cubesql/CLAUDE.md +++ b/rust/cubesql/CLAUDE.md @@ -15,7 +15,7 @@ This is a Rust workspace containing three crates: ### Prerequisites ```bash -# Install required Rust toolchain (1.84.1) +# Install required Rust toolchain (1.90.0) rustup update # Install snapshot testing tool diff --git a/rust/cubesql/rust-toolchain.toml b/rust/cubesql/rust-toolchain.toml index d9f5179de3d93..206200db71083 100644 --- a/rust/cubesql/rust-toolchain.toml +++ b/rust/cubesql/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/rust/cubesqlplanner/rust-toolchain.toml b/rust/cubesqlplanner/rust-toolchain.toml index 8237034eda99e..01c529b889912 100644 --- a/rust/cubesqlplanner/rust-toolchain.toml +++ b/rust/cubesqlplanner/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.84.1" +channel = "1.90.0" components = ["rustfmt", "rustc-dev", "clippy"] profile = "minimal" From bae24db5381149e1c590787deca94e8fdc36f37a Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:09:44 +0200 Subject: [PATCH 02/10] chore: fix --- rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs index 96ae42f568fc3..200c9bf8757cc 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs @@ -545,7 +545,7 @@ impl egg::RewriteScheduler for Increme self.current_eclasses.extend( egraph .classes() - .filter(|class| (class.data.iteration_timestamp >= iteration)) + .filter(|class| class.data.iteration_timestamp >= iteration) .map(|class| class.id), ); }; From 36c37a702d48c3773b98b2351af79ad298024500 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:16:13 +0200 Subject: [PATCH 03/10] chore: fix --- rust/cubesql/cubesql/src/compile/engine/df/scan.rs | 9 ++++++--- rust/cubesql/cubesql/src/compile/rewrite/mod.rs | 8 ++++---- rust/cubesql/cubesql/src/transport/ctx.rs | 7 +++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/engine/df/scan.rs b/rust/cubesql/cubesql/src/compile/engine/df/scan.rs index 19d6ccf8b2527..cf6e6af5f28e4 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/scan.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/scan.rs @@ -271,8 +271,11 @@ pub enum FieldValue<'a> { pub trait ValueObject { fn len(&mut self) -> std::result::Result; - fn get(&mut self, index: usize, field_name: &str) - -> std::result::Result; + fn get( + &mut self, + index: usize, + field_name: &str, + ) -> std::result::Result, CubeError>; } pub struct JsonValueObject { @@ -294,7 +297,7 @@ impl ValueObject for JsonValueObject { &mut self, index: usize, field_name: &str, - ) -> std::result::Result { + ) -> std::result::Result, CubeError> { let Some(as_object) = self.rows[index].as_object() else { return Err(CubeError::user(format!( "Unexpected response from Cube, row is not an object: {:?}", diff --git a/rust/cubesql/cubesql/src/compile/rewrite/mod.rs b/rust/cubesql/cubesql/src/compile/rewrite/mod.rs index b9abce1be32fb..8cff4ed6bf223 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/mod.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/mod.rs @@ -1076,7 +1076,7 @@ impl Searcher for ListNodeSearcher { egraph: &CubeEGraph, eclass: Id, limit: usize, - ) -> Option> { + ) -> Option> { let mut matches = SearchMatches { substs: vec![], eclass, @@ -1097,7 +1097,7 @@ impl Searcher for ListNodeSearcher { egraph: &CubeEGraph, eclasses: &mut dyn Iterator, limit: usize, - ) -> Vec> { + ) -> Vec> { let mut result: Vec> = vec![]; self.list_pattern @@ -2280,7 +2280,7 @@ impl Searcher for ChainSearcher { egraph: &CubeEGraph, eclasses: &mut dyn Iterator, limit: usize, - ) -> Vec> { + ) -> Vec> { let matches = self .main .search_eclasses_with_limit(egraph, eclasses, limit); @@ -2298,7 +2298,7 @@ impl Searcher for ChainSearcher { egraph: &CubeEGraph, eclass: Id, limit: usize, - ) -> Option> { + ) -> Option> { if let Some(m) = self.main.search_eclass_with_limit(egraph, eclass, limit) { self.search_match_chained(egraph, m) } else { diff --git a/rust/cubesql/cubesql/src/transport/ctx.rs b/rust/cubesql/cubesql/src/transport/ctx.rs index b2645034f204c..63b001d70501d 100644 --- a/rust/cubesql/cubesql/src/transport/ctx.rs +++ b/rust/cubesql/cubesql/src/transport/ctx.rs @@ -114,7 +114,10 @@ impl MetaContext { } } - pub fn data_source_for_member_name(&self, member: &str) -> Result { + pub fn data_source_for_member_name( + &self, + member: &str, + ) -> Result, DataSourceError> { if self.is_synthetic_field(member) { return Ok(DataSource::Unrestricted); } @@ -128,7 +131,7 @@ impl MetaContext { pub fn data_source_for_member_names<'mem>( &self, members: impl IntoIterator, - ) -> Result { + ) -> Result, DataSourceError> { members .into_iter() .map(|member| self.data_source_for_member_name(member)) From 7fb2005dc58769e53670d047fbc0af43f8057a1c Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:21:54 +0200 Subject: [PATCH 04/10] chore: fix --- .../src/planner/planners/dimension_subquery_planner.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/cubesqlplanner/cubesqlplanner/src/planner/planners/dimension_subquery_planner.rs b/rust/cubesqlplanner/cubesqlplanner/src/planner/planners/dimension_subquery_planner.rs index 3c7e3be94eb8d..bf02ac3b1d528 100644 --- a/rust/cubesqlplanner/cubesqlplanner/src/planner/planners/dimension_subquery_planner.rs +++ b/rust/cubesqlplanner/cubesqlplanner/src/planner/planners/dimension_subquery_planner.rs @@ -173,7 +173,7 @@ impl DimensionSubqueryPlanner { self.sub_query_dims.is_empty() } - pub fn dimensions_refs(&self) -> Ref> { + pub fn dimensions_refs(&self) -> Ref<'_, HashMap> { self.dimensions_refs.borrow() } } From b6a064205c01952a208dbe24c85c527713a2ac56 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:29:18 +0200 Subject: [PATCH 05/10] chore: fix --- packages/cubejs-backend-native/src/cross/clrepr.rs | 2 +- packages/cubejs-backend-native/src/orchestrator.rs | 2 +- packages/cubejs-backend-native/src/stream.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cubejs-backend-native/src/cross/clrepr.rs b/packages/cubejs-backend-native/src/cross/clrepr.rs index 9e0b17b256668..1326c7b9c780c 100644 --- a/packages/cubejs-backend-native/src/cross/clrepr.rs +++ b/packages/cubejs-backend-native/src/cross/clrepr.rs @@ -43,7 +43,7 @@ impl CLReprObject { self.0.insert(key, value) } - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, String, CLRepr> { self.0.iter() } diff --git a/packages/cubejs-backend-native/src/orchestrator.rs b/packages/cubejs-backend-native/src/orchestrator.rs index f2d8a133a0726..5ab606766b5ea 100644 --- a/packages/cubejs-backend-native/src/orchestrator.rs +++ b/packages/cubejs-backend-native/src/orchestrator.rs @@ -144,7 +144,7 @@ impl ValueObject for ResultWrapper { } } - fn get(&mut self, index: usize, field_name: &str) -> Result { + fn get(&mut self, index: usize, field_name: &str) -> Result, CubeError> { if self.transformed_data.is_none() { self.transform_result()?; } diff --git a/packages/cubejs-backend-native/src/stream.rs b/packages/cubejs-backend-native/src/stream.rs index 9ba7168c27166..8dcac034d9608 100644 --- a/packages/cubejs-backend-native/src/stream.rs +++ b/packages/cubejs-backend-native/src/stream.rs @@ -200,7 +200,7 @@ impl ValueObject for JsValueObject<'_> { Ok(self.handle.len(&mut self.cx) as usize) } - fn get(&mut self, index: usize, field_name: &str) -> Result { + fn get(&mut self, index: usize, field_name: &str) -> Result, CubeError> { let value = self .handle .get::(&mut self.cx, index as u32) From 5a8d177ea62416e84ef75b70204dffa53656620d Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:34:54 +0200 Subject: [PATCH 06/10] chore: fix --- .../cubesql/src/compile/engine/df/wrapper.rs | 16 ++++++++-------- .../cubesql/src/compile/rewrite/rules/members.rs | 2 +- rust/cubesql/pg-srv/src/buffer.rs | 5 +---- rust/cubesql/pg-srv/src/values/date.rs | 11 ++++------- rust/cubesql/pg-srv/src/values/timestamp.rs | 5 ++--- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs b/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs index e3fd768e907cb..cea0b49c9236f 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs @@ -137,17 +137,17 @@ fn extract_group_type_from_groupping_set( match expr { Expr::GroupingSet(groupping_set) => match groupping_set { GroupingSet::Rollup(exprs) => { - result.extend( - iter::repeat(Some(GroupingSetDesc::new(GroupingSetType::Rollup, id))) - .take(exprs.len()), - ); + result.extend(std::iter::repeat_n( + Some(GroupingSetDesc::new(GroupingSetType::Rollup, id)), + exprs.len(), + )); id += 1; } GroupingSet::Cube(exprs) => { - result.extend( - iter::repeat(Some(GroupingSetDesc::new(GroupingSetType::Cube, id))) - .take(exprs.len()), - ); + result.extend(std::iter::repeat_n( + Some(GroupingSetDesc::new(GroupingSetType::Cube, id)), + exprs.len(), + )); id += 1; } GroupingSet::GroupingSets(_) => { diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs b/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs index 81721abf9575b..981006b80bace 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs @@ -2708,7 +2708,7 @@ impl MemberRules { let Some(left_cube) = left_join_hints .iter() .filter(|hint| !hint.is_empty()) - .last() + .next_back() .and_then(|hint| hint.last()) .or_else(|| left_alias_to_cube.first().map(|(_, cube)| cube)) .cloned() diff --git a/rust/cubesql/pg-srv/src/buffer.rs b/rust/cubesql/pg-srv/src/buffer.rs index 4e6d7711a498b..772c25ad2dbb0 100644 --- a/rust/cubesql/pg-srv/src/buffer.rs +++ b/rust/cubesql/pg-srv/src/buffer.rs @@ -94,10 +94,7 @@ pub async fn read_contents( // protocol defines length for all types of messages let length = reader.read_u32().await?; if length < 4 { - return Err(Error::new( - ErrorKind::Other, - "Unexpectedly small (<0) message size", - )); + return Err(Error::other("Unexpectedly small (<0) message size")); } trace!( diff --git a/rust/cubesql/pg-srv/src/values/date.rs b/rust/cubesql/pg-srv/src/values/date.rs index e236424806a60..8e481d2bd0661 100644 --- a/rust/cubesql/pg-srv/src/values/date.rs +++ b/rust/cubesql/pg-srv/src/values/date.rs @@ -21,13 +21,10 @@ impl ToProtocolValue for DateValue { .signed_duration_since(pg_base_date_epoch().date()) .num_days(); if n > (i32::MAX as i64) { - return Err(Error::new( - ErrorKind::Other, - format!( - "value too large to store in the binary format (i32), actual: {}", - n - ), - ) + return Err(Error::other(format!( + "value too large to store in the binary format (i32), actual: {}", + n + )) .into()); } diff --git a/rust/cubesql/pg-srv/src/values/timestamp.rs b/rust/cubesql/pg-srv/src/values/timestamp.rs index cfb01bc7f6940..11a106cb1bef3 100644 --- a/rust/cubesql/pg-srv/src/values/timestamp.rs +++ b/rust/cubesql/pg-srv/src/values/timestamp.rs @@ -52,7 +52,7 @@ impl TimestampValue { .as_ref() .unwrap() .parse::() - .map_err(|err| io::Error::new(io::ErrorKind::Other, err.to_string()))?; + .map_err(|err| io::Error::other(err.to_string()))?; let ndt = self.to_naive_datetime(); Ok(tz.from_utc_datetime(&ndt)) } @@ -134,8 +134,7 @@ impl ToProtocolValue for TimestampValue { let n = ndt .signed_duration_since(pg_base_date_epoch()) .num_microseconds() - .ok_or(Error::new( - io::ErrorKind::Other, + .ok_or(Error::other( "Unable to extract number of seconds from timestamp", ))?; From 20ff1614151f6e299a678630756319b8dae269af Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:35:27 +0200 Subject: [PATCH 07/10] chore: fix --- rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs | 1 - rust/cubesql/pg-srv/src/values/date.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs b/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs index cea0b49c9236f..4b31eeb658169 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs @@ -44,7 +44,6 @@ use std::{ convert::TryInto, fmt, future::Future, - iter, pin::Pin, result, sync::{Arc, LazyLock}, diff --git a/rust/cubesql/pg-srv/src/values/date.rs b/rust/cubesql/pg-srv/src/values/date.rs index 8e481d2bd0661..d065bc39b9678 100644 --- a/rust/cubesql/pg-srv/src/values/date.rs +++ b/rust/cubesql/pg-srv/src/values/date.rs @@ -5,7 +5,7 @@ use byteorder::{BigEndian, ByteOrder}; use bytes::{BufMut, BytesMut}; use chrono::NaiveDate; use std::backtrace::Backtrace; -use std::io::{Error, ErrorKind}; +use std::io::Error; pub type DateValue = NaiveDate; From b46a16efa36c18f418783c4130944f31fa322de6 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:46:28 +0200 Subject: [PATCH 08/10] chore: fix --- rust/cubesql/cubesql/src/sql/postgres/extended.rs | 14 +++++++------- rust/cubesql/cubesql/src/sql/postgres/shim.rs | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rust/cubesql/cubesql/src/sql/postgres/extended.rs b/rust/cubesql/cubesql/src/sql/postgres/extended.rs index dcec115cc87b1..9d2871491e56f 100644 --- a/rust/cubesql/cubesql/src/sql/postgres/extended.rs +++ b/rust/cubesql/cubesql/src/sql/postgres/extended.rs @@ -27,9 +27,9 @@ use async_stream::stream; #[derive(Debug)] pub struct Cursor { - pub query: ast::Statement, + pub query: Box, // WITH HOLD specifies that the cursor can continue to be used after the transaction that created it successfully commits. - // WITHOUT HOLD specifies that the cursor cannot be used outside of the transaction that created it. + // WITHOUT HOLD specifies that the cursor cannot be used outside the transaction that created it. pub hold: bool, // What format will be used for Cursor pub format: protocol::Format, @@ -37,7 +37,7 @@ pub struct Cursor { #[derive(Debug)] pub enum PreparedStatement { - // Postgres allows to define prepared statement on empty query: "", + // Postgres allows defining a prepared statement on an empty query: "", // then it requires special handling in the protocol Empty { /// Prepared statement can be declared from SQL or protocol (Parser) @@ -49,10 +49,10 @@ pub enum PreparedStatement { /// Prepared statement can be declared from SQL or protocol (Parser) from_sql: bool, created: DateTime, - query: ast::Statement, + query: Box, parameters: protocol::ParameterDescription, - /// Fields which will be returned to the client, It can be None if server doesnt return any field - /// for example BEGIN + /// Fields which will be returned to the client; It can be None if the server doesn't return any field, + /// for example, BEGIN description: Option, span_id: Option>, }, @@ -107,7 +107,7 @@ impl PreparedStatement { .into()), PreparedStatement::Query { query, .. } => { let binder = PostgresStatementParamsBinder::new(values); - let mut statement = query.clone(); + let mut statement = query.as_ref().clone(); binder.bind(&mut statement)?; Ok(statement) diff --git a/rust/cubesql/cubesql/src/sql/postgres/shim.rs b/rust/cubesql/cubesql/src/sql/postgres/shim.rs index e542d7a6a3d20..d8696baac2d05 100644 --- a/rust/cubesql/cubesql/src/sql/postgres/shim.rs +++ b/rust/cubesql/cubesql/src/sql/postgres/shim.rs @@ -1218,7 +1218,7 @@ impl AsyncPostgresShim { PreparedStatement::Query { from_sql, created: chrono::offset::Utc::now(), - query, + query: Box::new(query), parameters: protocol::ParameterDescription::new(parameters), description, span_id, @@ -1479,7 +1479,7 @@ impl AsyncPostgresShim { })?; let plan = convert_statement_to_cube_query( - cursor.query.clone(), + cursor.query.as_ref().clone(), meta, self.session.clone(), qtrace, @@ -1556,7 +1556,7 @@ impl AsyncPostgresShim { .await?; let cursor = Cursor { - query: select_stmt, + query: Box::new(select_stmt), hold: hold.unwrap_or(false), format: if binary { Format::Binary } else { Format::Text }, }; From 5fe8a234e497d075deae5bcef1841c7ca8054b8b Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:47:57 +0200 Subject: [PATCH 09/10] chore: fix --- rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs b/rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs index a8d5aa697f348..99cf86cfb7cfc 100644 --- a/rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs +++ b/rust/cubesql/cubesql/src/compile/rewrite/rules/filters.rs @@ -2983,7 +2983,7 @@ impl FilterRules { subst, &meta_context, alias_to_cube_var, - &[column.clone()], + std::slice::from_ref(column), members_var, &aliases, ) else { From 9fe14e6b3226fe3dd880a7f47e40f396207735cd Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 23 Sep 2025 13:59:36 +0200 Subject: [PATCH 10/10] chore: fix --- packages/cubejs-backend-native/src/cross/clrepr_python.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cubejs-backend-native/src/cross/clrepr_python.rs b/packages/cubejs-backend-native/src/cross/clrepr_python.rs index 9ac669cedf62d..387aa42eb1025 100644 --- a/packages/cubejs-backend-native/src/cross/clrepr_python.rs +++ b/packages/cubejs-backend-native/src/cross/clrepr_python.rs @@ -144,7 +144,7 @@ impl CLRepr { }) } - fn into_py_dict_impl(obj: CLReprObject, py: Python) -> Result<&PyDict, PyErr> { + fn into_py_dict_impl(obj: CLReprObject, py: Python<'_>) -> Result<&PyDict, PyErr> { let r = PyDict::new(py); for (k, v) in obj.into_iter() { @@ -213,7 +213,7 @@ impl CLRepr { }) } - pub fn into_py_dict(self, py: Python) -> Result<&PyDict, PyErr> { + pub fn into_py_dict(self, py: Python<'_>) -> Result<&PyDict, PyErr> { Ok(match self { CLRepr::Object(obj) => Self::into_py_dict_impl(obj, py)?, other => {