thinkharderdev commented on a change in pull request #2120:
URL: https://github.com/apache/arrow-datafusion/pull/2120#discussion_r837679086



##########
File path: datafusion/proto/src/from_proto.rs
##########
@@ -581,12 +575,30 @@ impl TryFrom<&protobuf::scalar_value::Value> for 
ScalarValue {
                 )
             }
             Value::Date64Value(v) => ScalarValue::Date64(Some(*v)),
-            Value::TimeSecondValue(v) => 
ScalarValue::TimestampSecond(Some(*v), None),
-            Value::TimeMillisecondValue(v) => {
-                ScalarValue::TimestampMillisecond(Some(*v), None)
-            }
             Value::IntervalYearmonthValue(v) => 
ScalarValue::IntervalYearMonth(Some(*v)),
             Value::IntervalDaytimeValue(v) => 
ScalarValue::IntervalDayTime(Some(*v)),
+            Value::TimestampValue(v) => {
+                let ts_value = 
v.value.as_ref().ok_or(Error::required("value"))?;
+                let timezone = if v.timezone.is_empty() {
+                    None
+                } else {
+                    Some(v.timezone.clone())
+                };

Review comment:
       > Maybe it could be written like this:
   
   In this case `v.timezone` is a `String`. Rather than introduce a wrapper 
type to make an optional string field, this is just interpreting an empty 
string as `None`. 




-- 
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]


Reply via email to