rdblue commented on a change in pull request #1368:
URL: https://github.com/apache/iceberg/pull/1368#discussion_r477444758
##########
File path:
api/src/main/java/org/apache/iceberg/transforms/TimestampTransform.java
##########
@@ -127,6 +152,57 @@ public String toHumanString(Integer value) {
@Override
public String toString() {
- return name;
+ if (zoneOffset.getTotalSeconds() == 0) {
+ return name;
+ } else {
+ return name + "[" + zoneOffset.getId() + "]";
+ }
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+ if (other == null || getClass() != other.getClass()) {
+ return false;
+ }
+ TimestampTransform that = (TimestampTransform) other;
+ return granularity == that.granularity &&
+ Objects.equal(name, that.name) &&
+ Objects.equal(zoneOffset, that.zoneOffset);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(granularity, name, zoneOffset);
+ }
+
+ public ChronoUnit getGranularity() {
Review comment:
In Iceberg, we don't use `get` because it doesn't add value. Can you
change this to `granularity`?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]