Skip to content

Commit 05fe6a5

Browse files
committed
Refactor casting functionality for internal use
Change `cast_with_target_field_and_options` to crate-internal by modifying its visibility. Remove public re-export of the planner-only helper while retaining planner access via the internal module path. Make the `cast` module available within the crate for internal usage.
1 parent 95fc886 commit 05fe6a5

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

datafusion/physical-expr/src/expressions/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub fn cast_with_options(
330330

331331
/// Return a [`PhysicalExpr`] representing `expr` casted to `target_field`,
332332
/// preserving the field metadata in the resulting expression.
333-
pub fn cast_with_target_field_and_options(
333+
pub(crate) fn cast_with_target_field_and_options(
334334
expr: Arc<dyn PhysicalExpr>,
335335
input_schema: &Schema,
336336
target_field: FieldRef,

datafusion/physical-expr/src/expressions/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#[macro_use]
2121
mod binary;
2222
mod case;
23-
mod cast;
23+
pub(crate) mod cast;
2424
mod cast_column;
2525
mod column;
2626
mod dynamic_filters;
@@ -41,7 +41,7 @@ pub use crate::aggregate::stats::StatsType;
4141

4242
pub use binary::{BinaryExpr, binary, similar_to};
4343
pub use case::{CaseExpr, case};
44-
pub use cast::{CastExpr, cast, cast_with_target_field_and_options};
44+
pub use cast::{CastExpr, cast};
4545
pub use cast_column::CastColumnExpr;
4646
pub use column::{Column, col, with_new_schema};
4747
pub use datafusion_expr::utils::format_state_name;

datafusion/physical-expr/src/planner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub fn create_physical_expr(
289289
Ok(expressions::case(expr, when_then_expr, else_expr)?)
290290
}
291291
Expr::Cast(Cast { expr, field }) => {
292-
expressions::cast_with_target_field_and_options(
292+
expressions::cast::cast_with_target_field_and_options(
293293
create_physical_expr(expr, input_dfschema, execution_props)?,
294294
input_schema,
295295
Arc::clone(field),

0 commit comments

Comments
 (0)