LadyForest commented on code in PR #119:
URL: https://github.com/apache/flink-table-store/pull/119#discussion_r870916347


##########
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/TableStoreFactory.java:
##########
@@ -147,7 +153,22 @@ public void onDropTable(Context context, boolean 
ignoreIfNotExists) {
     @Override
     public Map<String, String> onCompactTable(
             Context context, CatalogPartitionSpec catalogPartitionSpec) {
-        throw new UnsupportedOperationException("Not implement yet");
+        Map<String, String> newOptions = new 
HashMap<>(context.getCatalogTable().getOptions());
+        FileStore fileStore = buildTableStore(context).buildFileStore();
+        Predicate partitionFilter =
+                PredicateConverter.CONVERTER.fromMap(
+                        catalogPartitionSpec.getPartitionSpec(), 
fileStore.partitionType());
+        FileStoreScan.Plan plan = 
fileStore.newScan().withPartitionFilter(partitionFilter).plan();
+        PartitionedManifestMeta manifestMeta =
+                new PartitionedManifestMeta(
+                        plan.snapshotId(),
+                        plan.groupByPartFiles(),
+                        fileStore.partitionType(),
+                        fileStore.keyType(),
+                        fileStore.valueType());
+        // TODO: filter manifest entries whose key range have overlap

Review Comment:
   Please correct me if I'm wrong.
   
   We can leverage the filter process to `CompactStrategy.pick` to get manifest 
entries whose key ranges are overlapped (or more accurately, which files need 
to be compacted)? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to