-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update workspace to use Rust 1.89 #17100
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
Changes from all commits
33b8aad
c507b4e
e882147
6853f21
76f57d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ impl TableProvider for CteWorkTable { | |
self | ||
} | ||
|
||
fn get_logical_plan(&self) -> Option<Cow<LogicalPlan>> { | ||
fn get_logical_plan(&'_ self) -> Option<Cow<'_, LogicalPlan>> { | ||
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. lifetime added |
||
None | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ use datafusion_physical_plan::ExecutionPlan; | |
/// [`CatalogProvider`]: super::CatalogProvider | ||
#[async_trait] | ||
pub trait TableProvider: Debug + Sync + Send { | ||
/// Returns the table provider as [`Any`](std::any::Any) so that it can be | ||
/// Returns the table provider as [`Any`] so that it can be | ||
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. doc cleanup (redundant link target removed) |
||
/// downcast to a specific implementation. | ||
fn as_any(&self) -> &dyn Any; | ||
|
||
|
@@ -75,7 +75,7 @@ pub trait TableProvider: Debug + Sync + Send { | |
} | ||
|
||
/// Get the [`LogicalPlan`] of this table, if available. | ||
fn get_logical_plan(&self) -> Option<Cow<LogicalPlan>> { | ||
fn get_logical_plan(&'_ self) -> Option<Cow<'_, LogicalPlan>> { | ||
None | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,11 +237,11 @@ impl FileOpener for ParquetOpener { | |
)?; | ||
} | ||
|
||
if coerce_int96.is_some() { | ||
if let Some(ref coerce) = coerce_int96 { | ||
if let Some(merged) = coerce_int96_to_resolution( | ||
reader_metadata.parquet_schema(), | ||
&physical_file_schema, | ||
&(coerce_int96.unwrap()), | ||
coerce, | ||
Comment on lines
-240
to
+244
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. simplified |
||
) { | ||
physical_file_schema = Arc::new(merged); | ||
options = options.with_schema(Arc::clone(&physical_file_schema)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -412,8 +412,8 @@ where | |
}?; | ||
|
||
let r = op(x, v); | ||
if r.is_ok() { | ||
val = Some(Ok(op2(r.unwrap()))); | ||
if let Ok(inner) = r { | ||
val = Some(Ok(op2(inner))); | ||
Comment on lines
-415
to
+416
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. simplified |
||
break; | ||
} else { | ||
val = Some(r); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ macro_rules! export_functions { | |
#[macro_export] | ||
macro_rules! make_udf_function { | ||
($UDF:ty, $NAME:ident) => { | ||
#[allow(rustdoc::redundant_explicit_links)] | ||
#[doc = concat!("Return a [`ScalarUDF`](datafusion_expr::ScalarUDF) implementation of ", stringify!($NAME))] | ||
Comment on lines
+76
to
77
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. used |
||
pub fn $NAME() -> std::sync::Arc<datafusion_expr::ScalarUDF> { | ||
// Singleton instance of the function | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,11 +204,15 @@ where | |
V2: StringArrayType<'a>, | ||
T: OffsetSizeTrait, | ||
{ | ||
let array = if fill_array.is_none() { | ||
let array = if let Some(fill_array) = fill_array { | ||
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. simplified |
||
let mut builder: GenericStringBuilder<T> = GenericStringBuilder::new(); | ||
|
||
for (string, length) in string_array.iter().zip(length_array.iter()) { | ||
if let (Some(string), Some(length)) = (string, length) { | ||
for ((string, length), fill) in string_array | ||
.iter() | ||
.zip(length_array.iter()) | ||
.zip(fill_array.iter()) | ||
{ | ||
if let (Some(string), Some(length), Some(fill)) = (string, length, fill) { | ||
if length > i32::MAX as i64 { | ||
return exec_err!("lpad requested length {length} too large"); | ||
} | ||
|
@@ -220,10 +224,17 @@ where | |
} | ||
|
||
let graphemes = string.graphemes(true).collect::<Vec<&str>>(); | ||
let fill_chars = fill.chars().collect::<Vec<char>>(); | ||
|
||
if length < graphemes.len() { | ||
builder.append_value(graphemes[..length].concat()); | ||
} else if fill_chars.is_empty() { | ||
builder.append_value(string); | ||
} else { | ||
builder.write_str(" ".repeat(length - graphemes.len()).as_str())?; | ||
for l in 0..length - graphemes.len() { | ||
let c = *fill_chars.get(l % fill_chars.len()).unwrap(); | ||
builder.write_char(c)?; | ||
} | ||
builder.write_str(string)?; | ||
builder.append_value(""); | ||
} | ||
|
@@ -236,12 +247,8 @@ where | |
} else { | ||
let mut builder: GenericStringBuilder<T> = GenericStringBuilder::new(); | ||
|
||
for ((string, length), fill) in string_array | ||
.iter() | ||
.zip(length_array.iter()) | ||
.zip(fill_array.unwrap().iter()) | ||
{ | ||
if let (Some(string), Some(length), Some(fill)) = (string, length, fill) { | ||
for (string, length) in string_array.iter().zip(length_array.iter()) { | ||
if let (Some(string), Some(length)) = (string, length) { | ||
if length > i32::MAX as i64 { | ||
return exec_err!("lpad requested length {length} too large"); | ||
} | ||
|
@@ -253,17 +260,10 @@ where | |
} | ||
|
||
let graphemes = string.graphemes(true).collect::<Vec<&str>>(); | ||
let fill_chars = fill.chars().collect::<Vec<char>>(); | ||
|
||
if length < graphemes.len() { | ||
builder.append_value(graphemes[..length].concat()); | ||
} else if fill_chars.is_empty() { | ||
builder.append_value(string); | ||
} else { | ||
for l in 0..length - graphemes.len() { | ||
let c = *fill_chars.get(l % fill_chars.len()).unwrap(); | ||
builder.write_char(c)?; | ||
} | ||
builder.write_str(" ".repeat(length - graphemes.len()).as_str())?; | ||
builder.write_str(string)?; | ||
builder.append_value(""); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
slice fix (
std::slice::from_ref
)