Skip to content

Commit

Permalink
feat: Support TimestampNanosecond in CASE
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Feb 12, 2024
1 parent 1abe9d5 commit 0272f92
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion datafusion/physical-expr/src/expressions/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::expressions::try_cast;
use crate::PhysicalExpr;
use arrow::array::{self, *};
use arrow::compute::{and, cast, eq_dyn, is_null, not, or, or_kleene};
use arrow::datatypes::{DataType, Schema};
use arrow::datatypes::{DataType, Schema, TimeUnit};
use arrow::record_batch::RecordBatch;
use datafusion_common::{DataFusionError, Result};
use datafusion_expr::{binary_rule::coerce_types, ColumnarValue, Operator};
Expand Down Expand Up @@ -254,6 +254,13 @@ fn if_then_else(
true_values,
false_values
),
DataType::Timestamp(TimeUnit::Nanosecond, None) => if_then_else!(
array::TimestampNanosecondBuilder,
array::TimestampNanosecondArray,
bools,
true_values,
false_values
),
other => Err(DataFusionError::Execution(format!(
"CASE does not support '{:?}'",
other
Expand Down

0 comments on commit 0272f92

Please sign in to comment.