Skip to content

Commit 824a1a3

Browse files
committed
feat: Support TimestampNanosecond in CASE
1 parent 1abe9d5 commit 824a1a3

File tree

1 file changed

+8
-1
lines changed
  • datafusion/physical-expr/src/expressions

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::expressions::try_cast;
2121
use crate::PhysicalExpr;
2222
use arrow::array::{self, *};
2323
use arrow::compute::{and, cast, eq_dyn, is_null, not, or, or_kleene};
24-
use arrow::datatypes::{DataType, Schema};
24+
use arrow::datatypes::{DataType, Schema, TimeUnit};
2525
use arrow::record_batch::RecordBatch;
2626
use datafusion_common::{DataFusionError, Result};
2727
use datafusion_expr::{binary_rule::coerce_types, ColumnarValue, Operator};
@@ -254,6 +254,13 @@ fn if_then_else(
254254
true_values,
255255
false_values
256256
),
257+
DataType::Timestamp(TimeUnit::Nanosecond, None) => if_then_else!(
258+
array::TimestampNanosecondBuilder,
259+
array::TimestampNanosecondArray,
260+
bools,
261+
true_values,
262+
false_values
263+
),
257264
other => Err(DataFusionError::Execution(format!(
258265
"CASE does not support '{:?}'",
259266
other

0 commit comments

Comments
 (0)