Skip to content

Commit

Permalink
minor: improve error style (#5510)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Mar 8, 2023
1 parent e46924d commit ff013e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions datafusion/core/tests/simplification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ impl SimplifyInfo for MyInfo {
}

fn get_data_type(&self, expr: &Expr) -> Result<DataType> {
match expr.get_type(&self.schema) {
Ok(expr_data_type) => Ok(expr_data_type),
Err(e) => Err(e),
}
expr.get_type(&self.schema)
}
}

Expand Down
5 changes: 1 addition & 4 deletions datafusion/optimizer/src/simplify_expressions/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ impl<'a> SimplifyInfo for SimplifyContext<'a> {
/// Returns data type of this expr needed for determining optimized int type of a value
fn get_data_type(&self, expr: &Expr) -> Result<DataType> {
if self.schemas.len() == 1 {
match expr.get_type(&self.schemas[0]) {
Ok(expr_data_type) => Ok(expr_data_type),
Err(e) => Err(e),
}
expr.get_type(&self.schemas[0])
} else {
Err(DataFusionError::Internal(
"The expr has more than one schema, could not determine data type"
Expand Down

0 comments on commit ff013e2

Please sign in to comment.