wuchong commented on code in PR #2573:
URL: https://github.com/apache/fluss/pull/2573#discussion_r2778570790


##########
fluss-client/src/main/java/org/apache/fluss/client/lookup/TableLookup.java:
##########
@@ -35,37 +35,61 @@ public class TableLookup implements Lookup {
 
     @Nullable private final List<String> lookupColumnNames;
 
+    private final boolean insertIfNotExists;
+
     public TableLookup(
             TableInfo tableInfo,
             SchemaGetter schemaGetter,
             MetadataUpdater metadataUpdater,
             LookupClient lookupClient) {
-        this(tableInfo, schemaGetter, metadataUpdater, lookupClient, null);
+        this(tableInfo, schemaGetter, metadataUpdater, lookupClient, null, 
false);
     }
 
     private TableLookup(
             TableInfo tableInfo,
             SchemaGetter schemaGetter,
             MetadataUpdater metadataUpdater,
             LookupClient lookupClient,
-            @Nullable List<String> lookupColumnNames) {
+            @Nullable List<String> lookupColumnNames,
+            boolean insertIfNotExists) {
         this.tableInfo = tableInfo;
         this.schemaGetter = schemaGetter;
         this.metadataUpdater = metadataUpdater;
         this.lookupClient = lookupClient;
         this.lookupColumnNames = lookupColumnNames;
+        this.insertIfNotExists = insertIfNotExists;
+    }
+
+    @Override
+    public Lookup enableInsertIfNotExists() {
+        return new TableLookup(tableInfo, schemaGetter, metadataUpdater, 
lookupClient, null, true);
     }
 
     @Override
     public Lookup lookupBy(List<String> lookupColumnNames) {
         return new TableLookup(
-                tableInfo, schemaGetter, metadataUpdater, lookupClient, 
lookupColumnNames);
+                tableInfo, schemaGetter, metadataUpdater, lookupClient, 
lookupColumnNames, false);

Review Comment:
   We should copy with the existing `insertIfNotExists`, rather than override 
it to `false`. 



##########
fluss-client/src/main/java/org/apache/fluss/client/lookup/TableLookup.java:
##########
@@ -35,37 +35,61 @@ public class TableLookup implements Lookup {
 
     @Nullable private final List<String> lookupColumnNames;
 
+    private final boolean insertIfNotExists;
+
     public TableLookup(
             TableInfo tableInfo,
             SchemaGetter schemaGetter,
             MetadataUpdater metadataUpdater,
             LookupClient lookupClient) {
-        this(tableInfo, schemaGetter, metadataUpdater, lookupClient, null);
+        this(tableInfo, schemaGetter, metadataUpdater, lookupClient, null, 
false);
     }
 
     private TableLookup(
             TableInfo tableInfo,
             SchemaGetter schemaGetter,
             MetadataUpdater metadataUpdater,
             LookupClient lookupClient,
-            @Nullable List<String> lookupColumnNames) {
+            @Nullable List<String> lookupColumnNames,
+            boolean insertIfNotExists) {
         this.tableInfo = tableInfo;
         this.schemaGetter = schemaGetter;
         this.metadataUpdater = metadataUpdater;
         this.lookupClient = lookupClient;
         this.lookupColumnNames = lookupColumnNames;
+        this.insertIfNotExists = insertIfNotExists;
+    }
+
+    @Override
+    public Lookup enableInsertIfNotExists() {
+        return new TableLookup(tableInfo, schemaGetter, metadataUpdater, 
lookupClient, null, true);

Review Comment:
   We should copy with the existing `lookupColumnNames`, rather than override 
it to `null`.



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