mihaibudiu commented on code in PR #4761: URL: https://github.com/apache/calcite/pull/4761#discussion_r2718166673
########## core/src/main/java/org/apache/calcite/rel/type/RelDataTypeDigest.java: ########## @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.calcite.rel.type; + +/** + * Digest of a RelDataType. + */ +public interface RelDataTypeDigest { Review Comment: This could be two interfaces, in case Digest is useful somewhere else. ########## core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java: ########## @@ -60,7 +59,7 @@ public abstract class RelDataTypeImpl //~ Instance fields -------------------------------------------------------- protected final @Nullable List<RelDataTypeField> fieldList; - protected @Nullable String digest; + protected RelDataTypeDigest digest; Review Comment: Changing protected fields is a breaking change, which has to be reflected in the semantic versioning. This would require a 2.0 release. ########## core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java: ########## @@ -41,14 +39,15 @@ public JavaRecordType(List<RelDataTypeField> fields, Class clazz) { this.clazz = requireNonNull(clazz, "clazz"); } - @Override public boolean equals(@Nullable Object obj) { + @Override public boolean deepEquals(Object obj) { Review Comment: I think you'll need to leave the old implementations around too, they may break users who expect them to exist. ########## core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java: ########## @@ -60,7 +59,7 @@ public abstract class RelDataTypeImpl //~ Instance fields -------------------------------------------------------- protected final @Nullable List<RelDataTypeField> fieldList; - protected @Nullable String digest; + protected RelDataTypeDigest digest; Review Comment: On the other hand, I don't know what else you can do to make the digest lazy. Maybe other people can weigh on this dilemma. This is why you should probably file a JIRA issue just for this topic and discuss the design there. -- 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]
