dongjoon-hyun commented on a change in pull request #543:
URL: https://github.com/apache/orc/pull/543#discussion_r513172034



##########
File path: c++/include/orc/sargs/Literal.hh
##########
@@ -36,6 +36,33 @@ namespace orc {
    */
   class Literal {
   public:
+    struct Timestamp {
+      Timestamp() = default;
+      Timestamp(const Timestamp&) = default;
+      Timestamp(Timestamp&&) = default;
+      ~Timestamp() = default;
+      Timestamp(int64_t second_, int32_t nano_): second(second_), nano(nano_) {
+        // PASS
+      }
+      Timestamp& operator=(const Timestamp&) = default;
+      Timestamp& operator=(Timestamp&&) = default;
+      bool operator==(const Timestamp& r) const {
+        return second == r.second && nano == r.nano;
+      }
+      bool operator<(const Timestamp& r) const {
+        return second < r.second || (second == r.second && nano < r.nano);
+      }
+      bool operator<=(const Timestamp& r) const {
+        return second < r.second || (second == r.second && nano <= r.nano);
+      }
+      bool operator!=(const Timestamp& r) const { return !(*this == r); }
+      bool operator>(const Timestamp& r) const { return r < *this; }
+      bool operator>=(const Timestamp& r) const { return r <= *this; }
+      int64_t getMillis() const { return second * 1000 + nano / 1000000; }

Review comment:
       Is `nano / 1000000` safe? It looks like `0` always due to the integer 
division.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to