You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tsfile.apache.org by ja...@apache.org on 2024/01/29 02:42:53 UTC

(tsfile) branch ty/TsfileAlignedQuery created (now da97433c)

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

jackietien pushed a change to branch ty/TsfileAlignedQuery
in repository https://gitbox.apache.org/repos/asf/tsfile.git


      at da97433c Dicard all null row

This branch includes the following new commits:

     new da97433c Dicard all null row

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.



(tsfile) 01/01: Dicard all null row

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

jackietien pushed a commit to branch ty/TsfileAlignedQuery
in repository https://gitbox.apache.org/repos/asf/tsfile.git

commit da97433c85214b36bcb087292f976ae0666983cc
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Mon Jan 29 10:42:42 2024 +0800

    Dicard all null row
---
 .../java/org/apache/tsfile/read/reader/page/AlignedPageReader.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tsfile/src/main/java/org/apache/tsfile/read/reader/page/AlignedPageReader.java b/tsfile/src/main/java/org/apache/tsfile/read/reader/page/AlignedPageReader.java
index 421c3b68..b60a0b8d 100644
--- a/tsfile/src/main/java/org/apache/tsfile/read/reader/page/AlignedPageReader.java
+++ b/tsfile/src/main/java/org/apache/tsfile/read/reader/page/AlignedPageReader.java
@@ -101,6 +101,8 @@ public class AlignedPageReader implements IPageReader {
       timeIndex++;
 
       TsPrimitiveType[] v = new TsPrimitiveType[valueCount];
+      // if all the sub sensors' value are null in current row, just discard it
+      boolean hasNotNullValues = false;
       for (int i = 0; i < valueCount; i++) {
         ValuePageReader pageReader = valuePageReaderList.get(i);
         if (pageReader != null) {
@@ -110,9 +112,12 @@ public class AlignedPageReader implements IPageReader {
           v[i] = null;
           rowValues[i] = null;
         }
+        if (rowValues[i] != null) {
+          hasNotNullValues = true;
+        }
       }
 
-      if (satisfyRecordFilter(timestamp, rowValues)) {
+      if (hasNotNullValues && satisfyRecordFilter(timestamp, rowValues)) {
         pageData.putVector(timestamp, v);
       }
     }