LadyForest commented on a change in pull request #48:
URL: https://github.com/apache/flink-table-store/pull/48#discussion_r828923690



##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/TableStoreFactory.java
##########
@@ -271,8 +297,7 @@ private TableStore buildTableStore(Context context) {
                             .mapToInt(rowType.getFieldNames()::indexOf)
                             .toArray();
         }
-        return new TableStore(
-                        
Configuration.fromMap(filterFileStoreOptions(catalogTable.getOptions())))
+        return new TableStore(Configuration.fromMap(catalogTable.getOptions()))

Review comment:
       Why remove `filterFileStoreOptions(catalogTable.getOptions())`?
   `TableStore` is using this options directly to initialize `FileStoreImpl`, 
and `FileStoreImpl` is creating `FileStoreOptions` directly use the optoins. 
See the `// TODO validate all keys` in `FileStoreOptions`

##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/TableStore.java
##########
@@ -214,11 +218,19 @@ private long discoveryIntervalMills() {
 
         private FileStoreSource buildFileSource(boolean isContinuous) {
             FileStore fileStore = buildFileStore();
+
+            boolean latestContinuous = false;
+            if (isContinuous) {
+                LogStartupMode startupMode =
+                        new DelegatingConfiguration(options, 
LOG_PREFIX).get(SCAN);
+                latestContinuous = startupMode == LogStartupMode.LATEST;
+            }

Review comment:
       
![image](https://user-images.githubusercontent.com/55568005/158782971-6cde1582-36be-4972-8e98-7ff7bd6e7cad.png)
   

##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/source/FileStoreSource.java
##########
@@ -126,22 +132,31 @@ public Boundedness getBoundedness() {
         Long snapshotId;
         Collection<FileStoreSourceSplit> splits;
         if (checkpoint == null) {
-            FileStoreScan.Plan plan = scan.plan();
-            snapshotId = plan.snapshotId();
-            splits = new FileStoreSourceSplitGenerator().createSplits(plan);
+            // first, create new enumerator, plan splits
+            if (latestContinuous) {
+                checkArgument(isContinuous);

Review comment:
       please add an error message for `checkArgument`

##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/TableStoreFactory.java
##########
@@ -271,8 +297,7 @@ private TableStore buildTableStore(Context context) {
                             .mapToInt(rowType.getFieldNames()::indexOf)
                             .toArray();
         }
-        return new TableStore(
-                        
Configuration.fromMap(filterFileStoreOptions(catalogTable.getOptions())))
+        return new TableStore(Configuration.fromMap(catalogTable.getOptions()))

Review comment:
       I know `TableStore` also needs log options to decide log startup mode, 
but once we remove the `filterFileStoreOptions` here, we should add it back in 
`TableStore` (before `FileStoreOptions` created)

##########
File path: 
flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/ContinuousITCase.java
##########
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.store.connector;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.table.api.EnvironmentSettings;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.config.ExecutionConfigOptions;
+import org.apache.flink.test.util.AbstractTestBase;
+import org.apache.flink.types.Row;
+import org.apache.flink.util.CloseableIterator;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+import static 
org.apache.flink.streaming.api.environment.ExecutionCheckpointingOptions.CHECKPOINTING_INTERVAL;
+import static org.apache.flink.table.store.file.FileStoreOptions.FILE_PATH;
+import static 
org.apache.flink.table.store.file.FileStoreOptions.TABLE_STORE_PREFIX;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+/** SQL ITCase for continuous file store. */
+public class ContinuousITCase extends AbstractTestBase {

Review comment:
       `ContinuousFileStoreITCase`?

##########
File path: 
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/source/FileStoreSource.java
##########
@@ -62,13 +66,15 @@ public FileStoreSource(
             boolean valueCountMode,
             boolean isContinuous,
             long discoveryInterval,
+            boolean latestContinuous,

Review comment:
       I guess now the L#86 TODO can be achieved.
   
   ```java
   @Override
       public Boundedness getBoundedness() {
           return isContinuous ? Boundedness.CONTINUOUS_UNBOUNDED : 
Boundedness.BOUNDED;
       }
   ```

##########
File path: 
flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/TableStoreFactoryTest.java
##########
@@ -162,19 +162,6 @@ public void testFilterLogStoreOptions() {
                 .containsExactlyInAnyOrderEntriesOf(expectedLogOptions);
     }
 
-    @Test
-    public void testFilterFileStoreOptions() {

Review comment:
       I'm afraid that we still need this util method?




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