gortiz commented on code in PR #13303:
URL: https://github.com/apache/pinot/pull/13303#discussion_r1738879515


##########
pinot-common/src/main/java/org/apache/pinot/common/datablock/DataBlockEquals.java:
##########
@@ -0,0 +1,401 @@
+/**
+ * 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.pinot.common.datablock;
+
+import java.util.Arrays;
+import java.util.Objects;
+import org.apache.pinot.common.utils.DataSchema;
+import org.roaringbitmap.RoaringBitmap;
+
+
+/**
+ * A utility class used to compare two DataBlocks.
+ */
+public class DataBlockEquals {
+
+  private DataBlockEquals() {
+  }
+
+  /**
+   * Returns true if the two DataBlocks are of the same type, the same schema 
and contains the same data in the same
+   * data according to the {@link DefaultContentComparator default 
contentComparator}.
+   *
+   * This means that a DataBlock of type {@link DataBlock.Type#COLUMNAR} and a 
DataBlock of type
+   * {@link DataBlock.Type#ROW} will not be considered equal even if they 
contain the same data in the same order.
+   */
+  public static boolean equals(DataBlock left, DataBlock right) {

Review Comment:
   Right now they are only used by test code. I think it makes sense to keep it 
as production code because this is some kind of contract. I don't see right now 
a case where we want to actually compare two buffers in production, but there 
may be cases.



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to