andygrove commented on code in PR #3536:
URL: https://github.com/apache/datafusion-comet/pull/3536#discussion_r2822877037
##########
native/spark-expr/src/utils.rs:
##########
@@ -71,6 +72,49 @@ pub fn array_with_timezone(
to_type: Option<&DataType>,
) -> Result<ArrayRef, ArrowError> {
match array.data_type() {
+ DataType::Timestamp(TimeUnit::Millisecond, None) => {
+ assert!(!timezone.is_empty());
+ match to_type {
+ Some(DataType::Utf8) | Some(DataType::Date32) => Ok(array),
+ Some(DataType::Timestamp(_, Some(_))) => {
+ timestamp_ntz_to_timestamp(array, timezone.as_str(),
Some(timezone.as_str()))
+ }
+ Some(DataType::Timestamp(TimeUnit::Microsecond, None)) => {
+ // Convert from Timestamp(Millisecond, None) to
Timestamp(Microsecond, None)
+ let millis_array =
as_primitive_array::<TimestampMillisecondType>(&array);
+ let micros_array: TimestampMicrosecondArray = millis_array
+ .iter()
+ .map(|opt| opt.map(|v| v * 1000))
+ .collect();
Review Comment:
This could use unary kernel instead
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]