You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/02/02 03:09:18 UTC
[GitHub] [iceberg] yyanyy commented on a change in pull request #2096: Core: add schema id and schemas to table metadata
yyanyy commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r568292231
##########
File path: api/src/main/java/org/apache/iceberg/Schema.java
##########
@@ -328,6 +329,24 @@ private Schema internalSelect(Collection<String> names, boolean caseSensitive) {
return TypeUtil.select(this, selected);
}
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ } else if (!(other instanceof Schema)) {
+ return false;
+ }
+
+ Schema that = (Schema) other;
+ return struct.equals(that.struct) &&
+ Objects.equals(aliasToId, that.aliasToId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(struct, aliasToId);
+ }
Review comment:
In the new change I introduced, we can reuse the old schema ID during schema update, if the exact same schema already exists in the schema list. I think in this case we may need to confirm both schemas' aliases should be the same? Or do you think there shouldn't be a case when schema are the same while aliases are not?
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org