Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-backend-native/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.84.1"
channel = "1.90.0"
components = ["rustfmt", "clippy"]
profile = "minimal"
2 changes: 1 addition & 1 deletion packages/cubejs-backend-native/src/cross/clrepr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl CLReprObject {
self.0.insert(key, value)
}

pub fn iter(&self) -> Iter<String, CLRepr> {
pub fn iter(&self) -> Iter<'_, String, CLRepr> {
self.0.iter()
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-backend-native/src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl ValueObject for ResultWrapper {
}
}

fn get(&mut self, index: usize, field_name: &str) -> Result<FieldValue, CubeError> {
fn get(&mut self, index: usize, field_name: &str) -> Result<FieldValue<'_>, CubeError> {
if self.transformed_data.is_none() {
self.transform_result()?;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-backend-native/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FieldValue, CubeError> {
fn get(&mut self, index: usize, field_name: &str) -> Result<FieldValue<'_>, CubeError> {
let value = self
.handle
.get::<JsObject, _, _>(&mut self.cx, index as u32)
Expand Down
2 changes: 1 addition & 1 deletion rust/cubenativeutils/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.84.1"
channel = "1.90.0"
components = ["rustfmt", "rustc-dev", "clippy"]
profile = "minimal"
2 changes: 1 addition & 1 deletion rust/cubeorchestrator/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.84.1"
channel = "1.90.0"
components = ["rustfmt", "clippy"]
profile = "minimal"
2 changes: 1 addition & 1 deletion rust/cubeshared/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.84.1"
channel = "1.90.0"
components = ["rustfmt", "clippy"]
profile = "minimal"
2 changes: 1 addition & 1 deletion rust/cubesql/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions rust/cubesql/cubesql/src/compile/engine/df/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,11 @@ pub enum FieldValue<'a> {
pub trait ValueObject {
fn len(&mut self) -> std::result::Result<usize, CubeError>;

fn get(&mut self, index: usize, field_name: &str)
-> std::result::Result<FieldValue, CubeError>;
fn get(
&mut self,
index: usize,
field_name: &str,
) -> std::result::Result<FieldValue<'_>, CubeError>;
}

pub struct JsonValueObject {
Expand All @@ -294,7 +297,7 @@ impl ValueObject for JsonValueObject {
&mut self,
index: usize,
field_name: &str,
) -> std::result::Result<FieldValue, CubeError> {
) -> std::result::Result<FieldValue<'_>, 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: {:?}",
Expand Down
17 changes: 8 additions & 9 deletions rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use std::{
convert::TryInto,
fmt,
future::Future,
iter,
pin::Pin,
result,
sync::{Arc, LazyLock},
Expand Down Expand Up @@ -137,17 +136,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(_) => {
Expand Down
8 changes: 4 additions & 4 deletions rust/cubesql/cubesql/src/compile/rewrite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ impl Searcher<LogicalPlanLanguage, LogicalPlanAnalysis> for ListNodeSearcher {
egraph: &CubeEGraph,
eclass: Id,
limit: usize,
) -> Option<SearchMatches<LogicalPlanLanguage>> {
) -> Option<SearchMatches<'_, LogicalPlanLanguage>> {
let mut matches = SearchMatches {
substs: vec![],
eclass,
Expand All @@ -1097,7 +1097,7 @@ impl Searcher<LogicalPlanLanguage, LogicalPlanAnalysis> for ListNodeSearcher {
egraph: &CubeEGraph,
eclasses: &mut dyn Iterator<Item = Id>,
limit: usize,
) -> Vec<SearchMatches<LogicalPlanLanguage>> {
) -> Vec<SearchMatches<'_, LogicalPlanLanguage>> {
let mut result: Vec<SearchMatches<_>> = vec![];

self.list_pattern
Expand Down Expand Up @@ -2280,7 +2280,7 @@ impl Searcher<LogicalPlanLanguage, LogicalPlanAnalysis> for ChainSearcher {
egraph: &CubeEGraph,
eclasses: &mut dyn Iterator<Item = Id>,
limit: usize,
) -> Vec<SearchMatches<LogicalPlanLanguage>> {
) -> Vec<SearchMatches<'_, LogicalPlanLanguage>> {
let matches = self
.main
.search_eclasses_with_limit(egraph, eclasses, limit);
Expand All @@ -2298,7 +2298,7 @@ impl Searcher<LogicalPlanLanguage, LogicalPlanAnalysis> for ChainSearcher {
egraph: &CubeEGraph,
eclass: Id,
limit: usize,
) -> Option<SearchMatches<LogicalPlanLanguage>> {
) -> Option<SearchMatches<'_, LogicalPlanLanguage>> {
if let Some(m) = self.main.search_eclass_with_limit(egraph, eclass, limit) {
self.search_match_chained(egraph, m)
} else {
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl egg::RewriteScheduler<LogicalPlanLanguage, LogicalPlanAnalysis> 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),
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ impl FilterRules {
subst,
&meta_context,
alias_to_cube_var,
&[column.clone()],
std::slice::from_ref(column),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

members_var,
&aliases,
) else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@ impl MemberRules {
let Some(left_cube) = left_join_hints
.iter()
.filter(|hint| !hint.is_empty())
.last()
.next_back()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.and_then(|hint| hint.last())
.or_else(|| left_alias_to_cube.first().map(|(_, cube)| cube))
.cloned()
Expand Down
14 changes: 7 additions & 7 deletions rust/cubesql/cubesql/src/sql/postgres/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ use async_stream::stream;

#[derive(Debug)]
pub struct Cursor {
pub query: ast::Statement,
pub query: Box<ast::Statement>,
// 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,
}

#[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)
Expand All @@ -49,10 +49,10 @@ pub enum PreparedStatement {
/// Prepared statement can be declared from SQL or protocol (Parser)
from_sql: bool,
created: DateTime<Utc>,
query: ast::Statement,
query: Box<ast::Statement>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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<protocol::RowDescription>,
span_id: Option<Arc<SpanId>>,
},
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions rust/cubesql/cubesql/src/sql/postgres/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
};
Expand Down
Loading
Loading