spaydar commented on code in PR #8159:
URL: https://github.com/apache/arrow-datafusion/pull/8159#discussion_r1409646213
##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -176,7 +176,20 @@ pub fn cast_column(
kernels::cast::cast_with_options(array, cast_type, &cast_options)?,
)),
ColumnarValue::Scalar(scalar) => {
- let scalar_array = scalar.to_array()?;
+ let scalar_array = if cast_type
+ == &DataType::Timestamp(arrow_schema::TimeUnit::Nanosecond,
None)
+ {
+ if let ScalarValue::Float64(Some(float_ts)) = scalar {
+ ScalarValue::Int64(
+ Some((float_ts * 1_000_000_000_f64).trunc() as i64),
Review Comment:
If we are allowing this type cast to be pushed down to the arrow crate, then
I can add this logic to `kernel::compute::cast_with_options` or the appropriate
fn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]