yuzelin commented on code in PR #1437:
URL: https://github.com/apache/incubator-paimon/pull/1437#discussion_r1243089620
##########
docs/content/how-to/querying-tables.md:
##########
@@ -119,13 +53,13 @@ SELECT * FROM t /*+ OPTIONS('scan.timestamp-millis' =
'1678883047356') */;
you can use `VERSION AS OF` and `TIMESTAMP AS OF` in query to do time travel:
```sql
--- travel to snapshot with id 1L (use snapshot id as version)
+-- read the snapshot with id 1L (use snapshot id as version)
Review Comment:
tab `Saprk3` -> `Spark 3.3+` ?
##########
paimon-core/src/main/java/org/apache/paimon/table/source/snapshot/IncrementalStartingScanner.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * 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.paimon.table.source.snapshot;
+
+import org.apache.paimon.Snapshot;
+import org.apache.paimon.Snapshot.CommitKind;
+import org.apache.paimon.data.BinaryRow;
+import org.apache.paimon.io.DataFileMeta;
+import org.apache.paimon.operation.ScanKind;
+import org.apache.paimon.table.source.DataSplit;
+import org.apache.paimon.utils.Pair;
+import org.apache.paimon.utils.SnapshotManager;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** {@link StartingScanner} for incremental changes. */
+public class IncrementalStartingScanner implements StartingScanner {
+
+ private final long s1;
+ private final long s2;
Review Comment:
`start`, `end` is better.
##########
paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java:
##########
@@ -199,6 +200,8 @@ private static void validateStartupMode(CoreOptions
options) {
options,
Collections.singletonList(SCAN_TIMESTAMP_MILLIS),
Arrays.asList(SCAN_SNAPSHOT_ID, SCAN_TAG_NAME));
+ } else if (options.startupMode() ==
CoreOptions.StartupMode.INCREMENTAL) {
+ checkOptionExistInMode(options, INCREMENTAL_BETWEEN,
options.startupMode());
Review Comment:
Conflict check?
##########
paimon-core/src/main/java/org/apache/paimon/table/source/AbstractInnerTableScan.java:
##########
@@ -130,6 +133,20 @@ protected StartingScanner createStartingScanner(boolean
isStreaming) {
return isStreaming
? new
ContinuousFromSnapshotFullStartingScanner(options.scanSnapshotId())
: new
StaticFromSnapshotStartingScanner(options.scanSnapshotId());
+ case INCREMENTAL:
+ checkArgument(!isStreaming, "Cannot read incremental in
streaming mode.");
+ Pair<String, String> incremental =
options.incrementalBetween();
+ Preconditions.checkNotNull(
+ incremental,
+ String.format(
+ "%s can not be null when you use %s for %s",
+ CoreOptions.INCREMENTAL_BETWEEN.key(),
+ startupMode,
+ CoreOptions.SCAN_MODE.key()));
Review Comment:
Maybe this is unnecessary because `SchemaValidation` has checked this.
--
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]