You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/08/14 13:38:16 UTC

[GitHub] [arrow] mapleFU commented on a diff in pull request #37135: GH-37110: [C++] Expression: SmallestTypeFor lost tz for Scalar

mapleFU commented on code in PR #37135:
URL: https://github.com/apache/arrow/pull/37135#discussion_r1293471546


##########
cpp/src/arrow/compute/expression_test.cc:
##########
@@ -630,6 +630,12 @@ TEST(Expression, BindWithImplicitCasts) {
                       literal(std::make_shared<TimestampScalar>(0, TimeUnit::NANO))),
                   cmp(field_ref("ts_s"),
                       literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND))));
+    // GH-37110
+    ExpectBindsTo(
+        cmp(field_ref("ts_s"),
+            literal(std::make_shared<TimestampScalar>(0, TimeUnit::NANO, "UTC"))),
+        cmp(field_ref("ts_s"),
+            literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND, "UTC"))));

Review Comment:
   Added, I also found that we need a UTC
   
   ```c++
   field("ts_s_utc", timestamp(TimeUnit::SECOND, "UTC"))
   ```



##########
cpp/src/arrow/compute/expression_test.cc:
##########
@@ -630,6 +630,12 @@ TEST(Expression, BindWithImplicitCasts) {
                       literal(std::make_shared<TimestampScalar>(0, TimeUnit::NANO))),
                   cmp(field_ref("ts_s"),
                       literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND))));
+    // GH-37110
+    ExpectBindsTo(
+        cmp(field_ref("ts_s"),
+            literal(std::make_shared<TimestampScalar>(0, TimeUnit::NANO, "UTC"))),
+        cmp(field_ref("ts_s"),
+            literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND, "UTC"))));

Review Comment:
   Added, I also found that we need a UTC type here.
   
   ```c++
   field("ts_s_utc", timestamp(TimeUnit::SECOND, "UTC"))
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org