Skip to content

Commit

Permalink
minor: change some plan_err to exec_err (#7996)
Browse files Browse the repository at this point in the history
* minor: change some plan_err to exec_err

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* change unreachable code to internal error

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
  • Loading branch information
waynexia authored Nov 1, 2023
1 parent e98625c commit 7d1cf91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions datafusion/physical-expr/src/expressions/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use arrow::{
datatypes::{DataType, Schema},
record_batch::RecordBatch,
};
use datafusion_common::plan_err;
use datafusion_common::{internal_err, DataFusionError, Result};
use datafusion_expr::ColumnarValue;

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

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

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::{internal_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")
internal_err!("NoOp::evaluate() should not be called")
}

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

0 comments on commit 7d1cf91

Please sign in to comment.