vldpyatkov commented on code in PR #5686: URL: https://github.com/apache/ignite-3/pull/5686#discussion_r2075958771
########## modules/schema/src/main/java/org/apache/ignite/internal/schema/PartialBinaryTupleMatcher.java: ########## @@ -0,0 +1,173 @@ +/* + * 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.ignite.internal.schema; + +import static org.apache.ignite.internal.binarytuple.BinaryTupleCommon.PREFIX_FLAG; +import static org.apache.ignite.internal.schema.BinaryTupleComparatorUtils.compareAsString; +import static org.apache.ignite.internal.schema.BinaryTupleComparatorUtils.compareFieldValue; +import static org.apache.ignite.internal.schema.BinaryTupleComparatorUtils.equalityFlag; +import static org.apache.ignite.internal.schema.BinaryTupleComparatorUtils.isFlagSet; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Arrays; +import java.util.List; +import org.apache.ignite.internal.binarytuple.BinaryTupleParser.Readability; +import org.apache.ignite.internal.binarytuple.BinaryTupleReader; +import org.apache.ignite.internal.catalog.descriptors.CatalogColumnCollation; +import org.apache.ignite.internal.type.NativeType; +import org.apache.ignite.internal.type.NativeTypeSpec; +import org.apache.ignite.internal.util.ByteUtils; + +/** + * Matcher for comparing {@link BinaryTuple}s on a per-column basis. + * + * <p>This comparator is used to compare BinaryTuples. The first tuple has to be an ordinal tuple that is gotten from persistent. + * The second tuple can be {@link BinaryTuplePrefix}. The mather assumes that the first tuple may have been written in the + * buffer partially. If the length of the tuple buffer is not enough to do a comparison, the comparator returns {@code 0}. + */ +@SuppressWarnings("ComparatorNotSerializable") +public class PartialBinaryTupleMatcher { Review Comment: It is not a comparator for two reasons: 1) This matcher supposes strict parameter order. The first parameter is a tuple from the storage (this parameter might be truncated), and the second is either from the storage or from the client side. 2) This class does not make a full comparison in case the first parameter does not have enough bytes. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org