Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
16 changes: 8 additions & 8 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,7 @@
convert::TryInto,
fmt,
future::Future,
iter,

Check warning on line 47 in rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs

View workflow job for this annotation

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

unused import: `iter`

Check warning on line 47 in rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `iter`
pin::Pin,
result,
sync::{Arc, LazyLock},
Expand Down Expand Up @@ -137,17 +137,17 @@
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 @@ -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
7 changes: 5 additions & 2 deletions rust/cubesql/cubesql/src/transport/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ impl MetaContext {
}
}

pub fn data_source_for_member_name(&self, member: &str) -> Result<DataSource, DataSourceError> {
pub fn data_source_for_member_name(
&self,
member: &str,
) -> Result<DataSource<'_>, DataSourceError> {
if self.is_synthetic_field(member) {
return Ok(DataSource::Unrestricted);
}
Expand All @@ -128,7 +131,7 @@ impl MetaContext {
pub fn data_source_for_member_names<'mem>(
&self,
members: impl IntoIterator<Item = &'mem str>,
) -> Result<DataSource, DataSourceError> {
) -> Result<DataSource<'_>, DataSourceError> {
members
.into_iter()
.map(|member| self.data_source_for_member_name(member))
Expand Down
5 changes: 1 addition & 4 deletions rust/cubesql/pg-srv/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ pub async fn read_contents<Reader: AsyncReadExt + Unpin>(
// 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!(
Expand Down
11 changes: 4 additions & 7 deletions rust/cubesql/pg-srv/src/values/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use bytes::{BufMut, BytesMut};
use chrono::NaiveDate;
use std::backtrace::Backtrace;
use std::io::{Error, ErrorKind};

Check warning on line 8 in rust/cubesql/pg-srv/src/values/date.rs

View workflow job for this annotation

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

unused import: `ErrorKind`

Check warning on line 8 in rust/cubesql/pg-srv/src/values/date.rs

View workflow job for this annotation

GitHub Actions / Build native linux (Python: 3.11)

unused import: `ErrorKind`

pub type DateValue = NaiveDate;

Expand All @@ -21,13 +21,10 @@
.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());
}

Expand Down
5 changes: 2 additions & 3 deletions rust/cubesql/pg-srv/src/values/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl TimestampValue {
.as_ref()
.unwrap()
.parse::<Tz>()
.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))
}
Expand Down Expand Up @@ -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",
))?;

Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/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"
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl DimensionSubqueryPlanner {
self.sub_query_dims.is_empty()
}

pub fn dimensions_refs(&self) -> Ref<HashMap<String, QualifiedColumnName>> {
pub fn dimensions_refs(&self) -> Ref<'_, HashMap<String, QualifiedColumnName>> {
self.dimensions_refs.borrow()
}
}
2 changes: 1 addition & 1 deletion rust/cubesqlplanner/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"
Loading