Skip to content
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

minor: change some plan_err to exec_err #7996

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions datafusion/physical-expr/src/expressions/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use arrow::{
datatypes::{DataType, Schema},
record_batch::RecordBatch,
};
use datafusion_common::plan_err;
use datafusion_common::exec_err;
use datafusion_common::{internal_err, DataFusionError, Result};
use datafusion_expr::ColumnarValue;

Expand Down Expand Up @@ -176,7 +176,7 @@ impl PhysicalExpr for UnKnownColumn {

/// Evaluate the expression
fn evaluate(&self, _batch: &RecordBatch) -> Result<ColumnarValue> {
plan_err!("UnKnownColumn::evaluate() should not be called")
exec_err!("UnKnownColumn::evaluate() should not be called")
Copy link
Contributor

Choose a reason for hiding this comment

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

If it means this line is unreachable, it should be Internal Error: if it's reached then there must be a bug in Datafusion (I remember it will print an error message to let the user file a GitHub issue for such error type)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense 👍

}

fn children(&self) -> Vec<Arc<dyn PhysicalExpr>> {
Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-expr/src/expressions/no_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use arrow::{

use crate::physical_expr::down_cast_any_ref;
use crate::PhysicalExpr;
use datafusion_common::{plan_err, DataFusionError, Result};
use datafusion_common::{exec_err, DataFusionError, Result};
use datafusion_expr::ColumnarValue;

/// A place holder expression, can not be evaluated.
Expand Down Expand Up @@ -65,7 +65,7 @@ impl PhysicalExpr for NoOp {
}

fn evaluate(&self, _batch: &RecordBatch) -> Result<ColumnarValue> {
plan_err!("NoOp::evaluate() should not be called")
exec_err!("NoOp::evaluate() should not be called")
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems also Internal Error 🤔

}

fn children(&self) -> Vec<Arc<dyn PhysicalExpr>> {
Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-expr/src/sort_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::PhysicalExpr;

use arrow::compute::kernels::sort::{SortColumn, SortOptions};
use arrow::record_batch::RecordBatch;
use datafusion_common::plan_err;
use datafusion_common::exec_err;
use datafusion_common::{DataFusionError, Result};
use datafusion_expr::ColumnarValue;

Expand Down Expand Up @@ -66,7 +66,7 @@ impl PhysicalSortExpr {
let array_to_sort = match value_to_sort {
ColumnarValue::Array(array) => array,
ColumnarValue::Scalar(scalar) => {
return plan_err!(
return exec_err!(
"Sort operation is not applicable to scalar value {scalar}"
);
}
Expand Down