Skip to content

Conversation

@hililiwei
Copy link
Contributor

@hililiwei hililiwei commented Jan 28, 2022

Supports overwriting table configuration, such upsert \ overwirte\ file-format, when creating Flink sink.。

@github-actions github-actions bot added the flink label Jan 28, 2022
@stevenzwu
Copy link
Contributor

initially, I misread the intention was to do partition overwrite for commit

    public Builder overwrite(boolean newOverwrite) {
      this.overwrite = newOverwrite;
      return this;
    }

Can we update the PR title to sth like "Support override write configuration on top of table properties in FlinkSink builder"?

@hililiwei hililiwei changed the title Flink: support overwrite configuration in the flink sink action Flink: Support override write configuration on top of table properties in FlinkSink builder Feb 7, 2022
@hililiwei hililiwei force-pushed the flink-sink-props branch 2 times, most recently from db3b8b0 to 36e434b Compare February 12, 2022 00:45
Copy link
Contributor

@rdblue rdblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks close, but I think that this changes behavior when the table is set through a table loader rather than directly. This should also have tests before we can merge it. Thanks for working on this, @hililiwei!

@hililiwei hililiwei force-pushed the flink-sink-props branch 2 times, most recently from 3f29f63 to 2ca5733 Compare February 19, 2022 08:55
@hililiwei hililiwei requested a review from rdblue February 21, 2022 05:58
@hililiwei hililiwei force-pushed the flink-sink-props branch 2 times, most recently from 68151c5 to 5cc1907 Compare March 1, 2022 10:52
@hililiwei hililiwei force-pushed the flink-sink-props branch 2 times, most recently from d4e671b to d56f406 Compare March 8, 2022 04:35
@hililiwei hililiwei requested a review from rdblue March 8, 2022 06:02
| write-format | Table write.format.default | File format to use for this write operation; parquet, avro, or orc |
| target-file-size-bytes | As per table property | Overrides this table's write.target-file-size-bytes |
| upsert-enabled | Table write.upsert.enabled | Overrides this table's write.upsert.enabled |
| overwrite | false | Overwrite the table's data |
Copy link
Collaborator

@chenjunjiedada chenjunjiedada Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we enable both upsert-enabled and overwrite? If not, should we need some doc?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: shall we use overwrite-enabled to keep the name consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good. done. we cann't enable both upsert-enabled and overwrite

return confParser.booleanConf()
.option(FlinkWriteOptions.OVERWRITE_MODE.key())
.flinkConfig(FlinkWriteOptions.OVERWRITE_MODE)
.defaultValue(false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use OVERWRITE_MODE_DEFAULT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@hililiwei
Copy link
Contributor Author

@rdblue, Could you please take another look?

@hililiwei hililiwei requested a review from chenjunjiedada June 29, 2022 00:38
Copy link
Collaborator

@chenjunjiedada chenjunjiedada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


| Flink option | Default | Description |
|------------------------| -------------------------- |------------------------------------------------------------------------------------------------------------|
| write-file-format | Table write.format.default | File format to use for this write operation; parquet, avro, or orc |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the same options that Spark uses? That way people don't have to remember different names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@hililiwei hililiwei requested a review from rdblue July 2, 2022 02:47
@rdblue
Copy link
Contributor

rdblue commented Jul 3, 2022

Thanks, @hililiwei! This looks good now. I'll merge.

@rdblue rdblue merged commit ff6cf54 into apache:master Jul 3, 2022
@hililiwei
Copy link
Contributor Author

Thanks all for the reviews. I will port it to all the another versions.

hililiwei added a commit to hililiwei/iceberg that referenced this pull request Jul 4, 2022
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
hililiwei added a commit to hililiwei/iceberg that referenced this pull request Jul 11, 2022
rdblue pushed a commit that referenced this pull request Jul 12, 2022
hililiwei added a commit to hililiwei/iceberg that referenced this pull request Oct 12, 2022
@hililiwei hililiwei deleted the flink-sink-props branch February 11, 2023 02:20
zhongyujiang added a commit to zhongyujiang/iceberg that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants