SteNicholas commented on code in PR #9287:
URL: https://github.com/apache/hudi/pull/9287#discussion_r1274853953
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java:
##########
@@ -145,18 +145,12 @@ public String asSummaryString() {
@Override
public void applyStaticPartition(Map<String, String> partitions) {
- // #applyOverwrite should have been invoked.
- if (this.overwrite && partitions.size() > 0) {
- this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE.value());
- }
}
@Override
public void applyOverwrite(boolean overwrite) {
this.overwrite = overwrite;
- // set up the operation as INSERT_OVERWRITE_TABLE first,
- // if there are explicit partitions, #applyStaticPartition would overwrite
the option.
- this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE_TABLE.value());
+ this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE.value());
Review Comment:
The semantics of Flink insert overwrite for partitioned table is that
inserts overwrite static or dynamic partition, not insert overwrite the whole
table. Therefore, it should be consistent with this semantics for
`HoodieTableSink` instead of supporting to insert overwrite the whole table by
users' requirement.
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSink.java:
##########
@@ -145,18 +145,12 @@ public String asSummaryString() {
@Override
public void applyStaticPartition(Map<String, String> partitions) {
- // #applyOverwrite should have been invoked.
- if (this.overwrite && partitions.size() > 0) {
- this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE.value());
- }
}
@Override
public void applyOverwrite(boolean overwrite) {
this.overwrite = overwrite;
- // set up the operation as INSERT_OVERWRITE_TABLE first,
- // if there are explicit partitions, #applyStaticPartition would overwrite
the option.
- this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE_TABLE.value());
+ this.conf.setString(FlinkOptions.OPERATION,
WriteOperationType.INSERT_OVERWRITE.value());
Review Comment:
@danny0405, the semantics of Flink insert overwrite for partitioned table is
that inserts overwrite static or dynamic partition, not insert overwrite the
whole table. Therefore, it should be consistent with this semantics for
`HoodieTableSink` instead of supporting to insert overwrite the whole table by
users' requirement.
--
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]