JackieTien97 commented on code in PR #370:
URL: https://github.com/apache/tsfile/pull/370#discussion_r1908064627


##########
java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/RunLengthEncodedColumn.java:
##########
@@ -221,6 +223,25 @@ public Column subColumnCopy(int fromIndex) {
     return new RunLengthEncodedColumn(valueCopy, positionCount - fromIndex);
   }
 
+  @Override
+  public Column getPositions(int[] positions, int offset, int length) {
+    checkArrayRange(positions, offset, length);
+
+    return DictionaryColumn.createInternal(
+        offset, length, this, positions, DictionaryId.randomDictionaryId());

Review Comment:
   why we still need `DictionaryColumn` for RLEColumn?



##########
java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/RunLengthEncodedColumn.java:
##########
@@ -221,6 +223,25 @@ public Column subColumnCopy(int fromIndex) {
     return new RunLengthEncodedColumn(valueCopy, positionCount - fromIndex);
   }
 
+  @Override
+  public Column getPositions(int[] positions, int offset, int length) {
+    checkArrayRange(positions, offset, length);
+
+    return DictionaryColumn.createInternal(
+        offset, length, this, positions, DictionaryId.randomDictionaryId());
+  }
+
+  @Override
+  public Column copyPositions(int[] positions, int offset, int length) {
+    checkArrayRange(positions, offset, length);
+
+    for (int position : positions) {
+      checkReadablePosition(this, position);
+    }
+
+    return new RunLengthEncodedColumn(value, length);

Review Comment:
   do the copy thing?



##########
java/common/src/main/java/org/apache/tsfile/block/column/Column.java:
##########
@@ -170,6 +170,23 @@ default TsPrimitiveType getTsPrimitiveType(int position) {
   /** This method will create a copy of origin column with different array 
offset. */
   Column subColumnCopy(int fromIndex);
 
+  /**
+   * Create a new colum from the current colum by keeping the same elements 
only with respect to
+   * {@code positions} that starts at {@code offset} and has length of {@code 
length}. The
+   * implementation may return a view over the data in this colum or may 
return a copy, and the
+   * implementation is allowed to retain the positions array for use in the 
view.
+   */
+  Column getPositions(int[] positions, int offset, int length);

Review Comment:
   why not use default method here?



-- 
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]

Reply via email to