You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/04/11 09:09:56 UTC

[iotdb] branch NeedLessContains created (now 588526ad4a)

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a change to branch NeedLessContains
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 588526ad4a Improve ineffective check in ColumnEncoderFactory

This branch includes the following new commits:

     new 588526ad4a Improve ineffective check in ColumnEncoderFactory

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: Improve ineffective check in ColumnEncoderFactory

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch NeedLessContains
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 588526ad4a0a1b7bb30294d74e9a73ce80f34450
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Tue Apr 11 17:09:37 2023 +0800

    Improve ineffective check in ColumnEncoderFactory
---
 .../iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
index 18c93afeea..2ac585643a 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/block/column/ColumnEncoderFactory.java
@@ -35,9 +35,10 @@ public class ColumnEncoderFactory {
   }
 
   public static ColumnEncoder get(ColumnEncoding columnEncoding) {
-    if (!encodingToEncoder.containsKey(columnEncoding)) {
+    ColumnEncoder res = encodingToEncoder.get(columnEncoding);
+    if (res == null) {
       throw new IllegalArgumentException("Unsupported column encoding: " + columnEncoding);
     }
-    return encodingToEncoder.get(columnEncoding);
+    return res;
   }
 }