You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/11/15 14:27:37 UTC

[GitHub] [flink-table-store] zjureel opened a new pull request, #382: [FLINK-30027] Fields min and max in BinaryTableStats support lazy deserialization

zjureel opened a new pull request, #382:
URL: https://github.com/apache/flink-table-store/pull/382

   `Predicate` get min and max from `BinaryRowData`, lazily deserialization.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-table-store] zjureel commented on pull request #382: [FLINK-30027] Fields min and max in BinaryTableStats support lazy deserialization

Posted by GitBox <gi...@apache.org>.
zjureel commented on PR #382:
URL: https://github.com/apache/flink-table-store/pull/382#issuecomment-1316394064

   @JingsongLi Done


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-table-store] JingsongLi merged pull request #382: [FLINK-30027] Fields min and max in BinaryTableStats support lazy deserialization

Posted by GitBox <gi...@apache.org>.
JingsongLi merged PR #382:
URL: https://github.com/apache/flink-table-store/pull/382


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-table-store] zjureel commented on a diff in pull request #382: [FLINK-30027] Fields min and max in BinaryTableStats support lazy deserialization

Posted by GitBox <gi...@apache.org>.
zjureel commented on code in PR #382:
URL: https://github.com/apache/flink-table-store/pull/382#discussion_r1023526130


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/stats/BinaryTableStats.java:
##########
@@ -73,27 +74,40 @@ public FieldStats[] fields(FieldStatsArraySerializer converter, @Nullable Long r
     }
 
     public BinaryRowData min() {
-        return min;
+        if (cacheMin == null) {
+            checkNotNull(row);
+            cacheMin = deserializeBinaryRow(this.row.getBinary(0));
+        }
+        return cacheMin;
     }
 
     public BinaryRowData max() {
-        return max;
+        if (cacheMax == null) {
+            checkNotNull(row);
+            cacheMax = deserializeBinaryRow(this.row.getBinary(1));
+        }
+        return cacheMax;
     }
 
     public long[] nullCounts() {
-        return nullCounts;
+        if (cacheNullCounts == null) {
+            checkNotNull(row);
+            cacheNullCounts = row.getArray(2).toLongArray();
+        }
+        return cacheNullCounts;
     }
 
     public RowData toRowData() {
-        return GenericRowData.of(
-                serializeBinaryRow(min), serializeBinaryRow(max), new GenericArrayData(nullCounts));
+        return row == null
+                ? GenericRowData.of(
+                        serializeBinaryRow(min()),
+                        serializeBinaryRow(max()),
+                        new GenericArrayData(nullCounts()))
+                : GenericRowData.of(row.getBinary(0), row.getBinary(1), row.getArray(2));

Review Comment:
   Done



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #382: [FLINK-30027] Fields min and max in BinaryTableStats support lazy deserialization

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on code in PR #382:
URL: https://github.com/apache/flink-table-store/pull/382#discussion_r1023442925


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/stats/BinaryTableStats.java:
##########
@@ -73,27 +74,40 @@ public FieldStats[] fields(FieldStatsArraySerializer converter, @Nullable Long r
     }
 
     public BinaryRowData min() {
-        return min;
+        if (cacheMin == null) {
+            checkNotNull(row);
+            cacheMin = deserializeBinaryRow(this.row.getBinary(0));
+        }
+        return cacheMin;
     }
 
     public BinaryRowData max() {
-        return max;
+        if (cacheMax == null) {
+            checkNotNull(row);
+            cacheMax = deserializeBinaryRow(this.row.getBinary(1));
+        }
+        return cacheMax;
     }
 
     public long[] nullCounts() {
-        return nullCounts;
+        if (cacheNullCounts == null) {
+            checkNotNull(row);
+            cacheNullCounts = row.getArray(2).toLongArray();
+        }
+        return cacheNullCounts;
     }
 
     public RowData toRowData() {
-        return GenericRowData.of(
-                serializeBinaryRow(min), serializeBinaryRow(max), new GenericArrayData(nullCounts));
+        return row == null
+                ? GenericRowData.of(
+                        serializeBinaryRow(min()),
+                        serializeBinaryRow(max()),
+                        new GenericArrayData(nullCounts()))
+                : GenericRowData.of(row.getBinary(0), row.getBinary(1), row.getArray(2));

Review Comment:
   Why not just return row?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org