You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Sxnan (via GitHub)" <gi...@apache.org> on 2024/10/12 01:59:22 UTC

[PR] Flink LookupTable support cache row filter [paimon]

Sxnan opened a new pull request, #4312:
URL: https://github.com/apache/paimon/pull/4312

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   Flink LookupTable support cache row filter to filter out rows to be stored in cache.
   
   ### Tests
   
   - UT added in `LookupTableTest` and `KeyValueFileReadWriteTest`.
   
   ### API and Format
   
   No
   
   ### Documentation
   
   No
   


-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "Sxnan (via GitHub)" <gi...@apache.org>.
Sxnan commented on code in PR #4312:
URL: https://github.com/apache/paimon/pull/4312#discussion_r1797674535


##########
paimon-core/src/main/java/org/apache/paimon/io/KeyValueFileReaderFactory.java:
##########
@@ -102,11 +103,23 @@ public RecordReader<KeyValue> createRecordReader(DataFileMeta file) throws IOExc
 
     public RecordReader<KeyValue> createRecordReader(
             long schemaId, String fileName, long fileSize, int level) throws IOException {
+        return createRecordReader(schemaId, fileName, fileSize, level, null);
+    }
+
+    public RecordReader<KeyValue> createRecordReader(

Review Comment:
   Good point! I updated the PR so we don't apply the filter in the `KeyValueFileReaderFactory`.  
   
   However, I think we still need to modify the `LocalTableQuery` in the `paimon-core` unless I am missing something.



-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on code in PR #4312:
URL: https://github.com/apache/paimon/pull/4312#discussion_r1798176331


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/FileStoreLookupFunction.java:
##########
@@ -361,4 +367,8 @@ protected Set<Integer> getRequireCachedBucketIds() {
         // TODO: Implement the method when Flink support bucket shuffle for lookup join.
         return null;
     }
+
+    protected void setCacheRowFilter(@Nullable Filter<InternalRow> cacheRowFilter) {

Review Comment:
   What business scenarios is this feature used in?



-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on code in PR #4312:
URL: https://github.com/apache/paimon/pull/4312#discussion_r1798174189


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/FileStoreLookupFunction.java:
##########
@@ -361,4 +367,8 @@ protected Set<Integer> getRequireCachedBucketIds() {
         // TODO: Implement the method when Flink support bucket shuffle for lookup join.
         return null;
     }
+
+    protected void setCacheRowFilter(@Nullable Filter<InternalRow> cacheRowFilter) {

Review Comment:
   Where this method be called?



-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #4312:
URL: https://github.com/apache/paimon/pull/4312


-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #4312:
URL: https://github.com/apache/paimon/pull/4312#discussion_r1797627342


##########
paimon-core/src/main/java/org/apache/paimon/io/KeyValueFileReaderFactory.java:
##########
@@ -102,11 +103,23 @@ public RecordReader<KeyValue> createRecordReader(DataFileMeta file) throws IOExc
 
     public RecordReader<KeyValue> createRecordReader(
             long schemaId, String fileName, long fileSize, int level) throws IOException {
+        return createRecordReader(schemaId, fileName, fileSize, level, null);
+    }
+
+    public RecordReader<KeyValue> createRecordReader(

Review Comment:
   I think you don't need to modify `paimon-core`, you can do the filter outer.



-- 
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@paimon.apache.org

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


Re: [PR] [flink] Flink LookupTable support cache row filter [paimon]

Posted by "Sxnan (via GitHub)" <gi...@apache.org>.
Sxnan commented on code in PR #4312:
URL: https://github.com/apache/paimon/pull/4312#discussion_r1798669105


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/FileStoreLookupFunction.java:
##########
@@ -361,4 +367,8 @@ protected Set<Integer> getRequireCachedBucketIds() {
         // TODO: Implement the method when Flink support bucket shuffle for lookup join.
         return null;
     }
+
+    protected void setCacheRowFilter(@Nullable Filter<InternalRow> cacheRowFilter) {

Review Comment:
   This change can reduce the memory usage of the lookup join function if how the fact table rows are shuffled is known by the lookup join function. We can filter out rows that will not shuffle to this specific subtask.
   
   For this feature to work, Flink will support specifying a custom data distribution of the fact table, please see the [FLIP](https://cwiki.apache.org/confluence/display/FLINK/FLIP-462+Support+Custom+Data+Distribution+for+Input+Stream+of+Lookup+Join).



-- 
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@paimon.apache.org

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