sashapolo commented on code in PR #2728:
URL: https://github.com/apache/ignite-3/pull/2728#discussion_r1370110801
##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryTuplePrefix.java:
##########
@@ -51,13 +52,36 @@ public BinaryTuplePrefix(int elementCount, ByteBuffer
buffer) {
super(elementCount, buffer);
}
+ /**
+ * Creates a prefix from provided {@link BinaryTuple}. If given tuple has
lesser or equal number of
+ * columns, then all elements will be used in resulting prefix. If given
tuple has more columns, then
+ * excess columns will be truncated.
+ *
+ * @param size The size of the complete tuple.
Review Comment:
agree
##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryTuplePrefix.java:
##########
@@ -51,13 +52,36 @@ public BinaryTuplePrefix(int elementCount, ByteBuffer
buffer) {
super(elementCount, buffer);
}
+ /**
+ * Creates a prefix from provided {@link BinaryTuple}. If given tuple has
lesser or equal number of
+ * columns, then all elements will be used in resulting prefix. If given
tuple has more columns, then
+ * excess columns will be truncated.
+ *
+ * @param size The size of the complete tuple.
+ * @param tuple Tuple to create a prefix from.
+ * @return Prefix, created from provided tuple with regards to desired
size.
+ */
+ public static BinaryTuplePrefix fromBinaryTuple(int size, BinaryTuple
tuple) {
+ if (size == tuple.elementCount()) {
+ return entireTuple(tuple);
+ } else if (size > tuple.elementCount()) {
Review Comment:
ok
--
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]