tustvold commented on code in PR #6412:
URL: https://github.com/apache/arrow-datafusion/pull/6412#discussion_r1201067120
##########
datafusion/common/src/scalar.rs:
##########
@@ -1760,17 +1760,17 @@ macro_rules! build_array_from_option {
None => new_null_array(&DataType::$DATA_TYPE($ENUM), $SIZE),
}
}};
- ($DATA_TYPE:ident, $ENUM:expr, $ENUM2:expr, $ARRAY_TYPE:ident, $EXPR:expr,
$SIZE:expr) => {{
+}
+
+macro_rules! build_timestamp_array_from_option {
+ ($TIME_UNIT:expr, $TZ:expr, $ARRAY_TYPE:ident, $EXPR:expr, $SIZE:expr) => {
match $EXPR {
Some(value) => {
- let array: ArrayRef = Arc::new($ARRAY_TYPE::from_value(*value,
$SIZE));
- // Need to call cast to cast to final data type with
timezone/extra param
- cast(&array, &DataType::$DATA_TYPE($ENUM, $ENUM2))
- .expect("cannot do temporal cast")
+ Arc::new($ARRAY_TYPE::from_value(*value,
$SIZE).with_timezone_opt($TZ))
Review Comment:
This is the major change, we use with_timezone_opt instead of cast, as cast
will now actually perform timezone conversion
--
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]