hililiwei commented on a change in pull request #3998:
URL: https://github.com/apache/iceberg/pull/3998#discussion_r837014168
##########
File path:
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
##########
@@ -339,15 +348,29 @@ public Builder setSnapshotProperty(String property,
String value) {
*/
@Deprecated
public DataStreamSink<RowData> build() {
- return chainIcebergOperators();
+ return append();
}
/**
* Append the iceberg sink operators to write records to iceberg table.
*
* @return {@link DataStreamSink} for sink.
*/
- public DataStreamSink<Void> append() {
+ @SuppressWarnings("rawtypes")
+ public DataStreamSink append() {
+ Preconditions.checkNotNull(tableLoader, "Table loader shouldn't be
null");
+
+ if (table == null) {
+ tableLoader.open();
+ try (TableLoader loader = tableLoader) {
+ this.table = loader.loadTable();
+ } catch (IOException e) {
+ throw new UncheckedIOException("Failed to load iceberg table from
table loader: " + tableLoader, e);
+ }
+ }
+
+ props = buildProperties(table);
Review comment:
ok, let me edit it.
##########
File path:
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
##########
@@ -339,15 +348,29 @@ public Builder setSnapshotProperty(String property,
String value) {
*/
@Deprecated
public DataStreamSink<RowData> build() {
- return chainIcebergOperators();
+ return append();
}
/**
* Append the iceberg sink operators to write records to iceberg table.
*
* @return {@link DataStreamSink} for sink.
*/
- public DataStreamSink<Void> append() {
+ @SuppressWarnings("rawtypes")
Review comment:
Reference
here:https://github.com/apache/iceberg/pull/3998#discussion_r812534842
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]