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/05/05 08:29:24 UTC

[GitHub] [flink-table-store] openinx commented on a diff in pull request #99: [FLINK-27307] Flink table store support append-only ingestion without primary keys.

openinx commented on code in PR #99:
URL: https://github.com/apache/flink-table-store/pull/99#discussion_r865668148


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/operation/FileStoreReadImpl.java:
##########
@@ -81,14 +87,42 @@ public FileStoreRead withValueProjection(int[][] projectedFields) {
     }
 
     @Override
-    public RecordReader createReader(BinaryRowData partition, int bucket, List<SstFileMeta> files)
+    public RecordReader createReader(BinaryRowData partition, int bucket, List<DataFileMeta> files)
             throws IOException {
+        switch (writeMode) {
+            case APPEND_ONLY:
+                return createAppendOnlyReader(partition, bucket, files);
+
+            case CHANGE_LOG:
+                return createLSMReader(partition, bucket, files);
+
+            default:
+                throw new UnsupportedOperationException("Unknown write mode: " + writeMode);
+        }
+    }
+
+    private RecordReader createAppendOnlyReader(
+            BinaryRowData partition, int bucket, List<DataFileMeta> files) throws IOException {
+        Preconditions.checkArgument(
+                !dropDelete, "Cannot drop delete message for append-only table.");
+
+        SstFileReader fileReader = sstFileReaderFactory.create(partition, bucket);

Review Comment:
   *TODO*
   
   Currently, both AppendOnlyReader and LSMReader are using the `SstFileReader`, while the `sst` concept should not be appeared in the append-only read path. So it's better to move this into a totally new `DataFileReader ` ? 



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