-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to rust 1.58 #1557
Merged
Merged
Update to rust 1.58 #1557
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ homepage = "https://github.com/apache/arrow-datafusion" | |
repository = "https://github.com/apache/arrow-datafusion" | ||
authors = ["Apache Arrow <[email protected]>"] | ||
edition = "2021" | ||
rust-version = "1.57" | ||
rust-version = "1.58" | ||
|
||
[dependencies] | ||
ballista-core = { path = "../core", version = "0.6.0" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,32 +39,32 @@ pub struct Rank { | |
|
||
#[derive(Debug, Copy, Clone)] | ||
pub(crate) enum RankType { | ||
Rank, | ||
DenseRank, | ||
PercentRank, | ||
Basic, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
Dense, | ||
Percent, | ||
} | ||
|
||
/// Create a rank window function | ||
pub fn rank(name: String) -> Rank { | ||
Rank { | ||
name, | ||
rank_type: RankType::Rank, | ||
rank_type: RankType::Basic, | ||
} | ||
} | ||
|
||
/// Create a dense rank window function | ||
pub fn dense_rank(name: String) -> Rank { | ||
Rank { | ||
name, | ||
rank_type: RankType::DenseRank, | ||
rank_type: RankType::Dense, | ||
} | ||
} | ||
|
||
/// Create a percent rank window function | ||
pub fn percent_rank(name: String) -> Rank { | ||
Rank { | ||
name, | ||
rank_type: RankType::PercentRank, | ||
rank_type: RankType::Percent, | ||
} | ||
} | ||
|
||
|
@@ -77,8 +77,8 @@ impl BuiltInWindowFunctionExpr for Rank { | |
fn field(&self) -> Result<Field> { | ||
let nullable = false; | ||
let data_type = match self.rank_type { | ||
RankType::Rank | RankType::DenseRank => DataType::UInt64, | ||
RankType::PercentRank => DataType::Float64, | ||
RankType::Basic | RankType::Dense => DataType::UInt64, | ||
RankType::Percent => DataType::Float64, | ||
}; | ||
Ok(Field::new(self.name(), data_type, nullable)) | ||
} | ||
|
@@ -121,7 +121,7 @@ impl PartitionEvaluator for RankEvaluator { | |
) -> Result<ArrayRef> { | ||
// see https://www.postgresql.org/docs/current/functions-window.html | ||
let result: ArrayRef = match self.rank_type { | ||
RankType::DenseRank => Arc::new(UInt64Array::from_iter_values( | ||
RankType::Dense => Arc::new(UInt64Array::from_iter_values( | ||
ranks_in_partition | ||
.iter() | ||
.zip(1u64..) | ||
|
@@ -130,7 +130,7 @@ impl PartitionEvaluator for RankEvaluator { | |
iter::repeat(rank).take(len) | ||
}), | ||
)), | ||
RankType::PercentRank => { | ||
RankType::Percent => { | ||
// Returns the relative rank of the current row, that is (rank - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive. | ||
let denominator = (partition.end - partition.start) as f64; | ||
Arc::new(Float64Array::from_iter_values( | ||
|
@@ -146,7 +146,7 @@ impl PartitionEvaluator for RankEvaluator { | |
.flatten(), | ||
)) | ||
} | ||
RankType::Rank => Arc::new(UInt64Array::from_iter_values( | ||
RankType::Basic => Arc::new(UInt64Array::from_iter_values( | ||
ranks_in_partition | ||
.iter() | ||
.scan(1_u64, |acc, range| { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,12 +320,8 @@ macro_rules! get_min_max_values { | |
}; | ||
|
||
let data_type = field.data_type(); | ||
let null_scalar: ScalarValue = if let Ok(v) = data_type.try_into() { | ||
v | ||
} else { | ||
// DataFusion doesn't have support for ScalarValues of the column type | ||
return None | ||
}; | ||
// The result may be None, because DataFusion doesn't have support for ScalarValues of the column type | ||
let null_scalar: ScalarValue = data_type.try_into().ok()?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
let scalar_values : Vec<ScalarValue> = $self.row_group_metadata | ||
.iter() | ||
|
@@ -441,11 +437,8 @@ fn read_partition( | |
break; | ||
} | ||
Some(Err(e)) => { | ||
let err_msg = format!( | ||
"Error reading batch from {}: {}", | ||
partitioned_file, | ||
e.to_string() | ||
); | ||
let err_msg = | ||
format!("Error reading batch from {}: {}", partitioned_file, e); | ||
// send error to operator | ||
send_result( | ||
&response_tx, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1739,7 +1739,7 @@ impl fmt::Display for ScalarValue { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
match self { | ||
ScalarValue::Decimal128(v, p, s) => { | ||
write!(f, "{}", format!("{:?},{:?},{:?}", v, p, s))?; | ||
write!(f, "{:?},{:?},{:?}", v, p, s)?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
ScalarValue::Boolean(e) => format_option!(f, e)?, | ||
ScalarValue::Float32(e) => format_option!(f, e)?, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args