klion26 commented on code in PR #4244:
URL: https://github.com/apache/amoro/pull/4244#discussion_r3410790102
##########
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/interceptor/KerberosInvocationHandler.java:
##########
@@ -56,7 +56,6 @@ public Object invoke(Object proxy, Method method, Object[]
args) throws Throwabl
authenticatedFileIO.doAs(
() -> {
try {
- method.setAccessible(true);
Review Comment:
Why do we need to change this,
##########
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/table/UnkeyedStreamingReaderOperator.java:
##########
@@ -0,0 +1,167 @@
+/*
+ * 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.amoro.flink.table;
+
+import org.apache.amoro.shade.guava32.com.google.common.base.Preconditions;
+import org.apache.amoro.shade.guava32.com.google.common.collect.Lists;
+import org.apache.flink.api.common.operators.MailboxExecutor;
+import org.apache.flink.api.common.state.ListState;
+import org.apache.flink.api.common.state.ListStateDescriptor;
+import org.apache.flink.runtime.state.JavaSerializer;
+import org.apache.flink.runtime.state.StateInitializationContext;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.functions.source.SourceFunction;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
+import org.apache.flink.streaming.api.operators.StreamSourceContexts;
+import org.apache.flink.streaming.api.watermark.Watermark;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.streaming.runtime.tasks.ProcessingTimeService;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.util.function.ThrowingRunnable;
+import org.apache.iceberg.flink.source.FlinkInputFormat;
+import org.apache.iceberg.flink.source.FlinkInputSplit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Queue;
+
+/** Minimal reader operator to avoid depending on Iceberg's non-public
StreamingReaderOperator. */
+public class UnkeyedStreamingReaderOperator extends
AbstractStreamOperator<RowData>
+ implements OneInputStreamOperator<FlinkInputSplit, RowData> {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(UnkeyedStreamingReaderOperator.class);
+
+ private final MailboxExecutor executor;
+ private FlinkInputFormat format;
+ private transient SourceFunction.SourceContext<RowData> sourceContext;
Review Comment:
Do we need to migrate to the new source api?
##########
.github/workflows/core-hadoop2-ci.yml:
##########
@@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- jdk: [ '11' ]
+ jdk: [ '11' , '17' ]
Review Comment:
Seems hadoop2 will active spark 3.3, why don't we need to exclude spark 3.3
here?
```
<profile>
<id>hadoop2</id>
<properties>
<guava.version>14.0.1</guava.version>
<!-- Do not use Hive 2.3.9 for Hive 4 Metastore support due
to incompatible API changes. -->
<hive.version>2.3.8</hive.version>
<hadoop.version>2.10.2</hadoop.version>
<spark.version>3.3.4</spark.version>
<spark.major.version>3.3</spark.major.version>
<hadoop-client-api.artifact>hadoop-client</hadoop-client-api.artifact>
<hadoop-client-runtime.artifact>hadoop-auth</hadoop-client-runtime.artifact>
</properties>
</profile>
```
##########
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/table/FlinkSource.java:
##########
@@ -243,37 +244,55 @@ public DataStream<RowData> buildUnkeyedTableSource(String
scanStartupMode) {
.properties(properties)
.flinkConf(flinkConf)
.limit(limit);
+ Long startSnapshotId = null;
if
(MixedFormatValidator.SCAN_STARTUP_MODE_LATEST.equalsIgnoreCase(scanStartupMode))
{
Optional<Snapshot> startSnapshotOptional =
Optional.ofNullable(tableLoader.loadTable().currentSnapshot());
if (startSnapshotOptional.isPresent()) {
Snapshot snapshot = startSnapshotOptional.get();
+ startSnapshotId = snapshot.snapshotId();
LOG.info(
"Get starting snapshot id {} based on scan startup mode {}",
snapshot.snapshotId(),
scanStartupMode);
- builder.startSnapshotId(snapshot.snapshotId());
+ builder.startSnapshotId(startSnapshotId);
}
}
DataStream<RowData> origin = builder.build();
- return wrapKrb(origin).assignTimestampsAndWatermarks(watermarkStrategy);
+ return wrapKrb(origin,
startSnapshotId).assignTimestampsAndWatermarks(watermarkStrategy);
}
/** extract op from dataStream, and wrap krb support */
- private DataStream<RowData> wrapKrb(DataStream<RowData> ds) {
+ private DataStream<RowData> wrapKrb(DataStream<RowData> ds, Long
startSnapshotId) {
Review Comment:
Seems `startSnapshotId` could be null, maybe we can add `Nullable`
annotation for it.
--
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]