yupeng9 commented on a change in pull request #6096:
URL: https://github.com/apache/incubator-pinot/pull/6096#discussion_r499107805
##########
File path:
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/UpsertConfig.java
##########
@@ -27,44 +27,22 @@
public class UpsertConfig extends BaseJsonConfig {
- // names of the columns that used as primary keys of an upsert table
- private final List<String> _primaryKeyColumns;
- // name of the column that we are going to store the offset value to
- private final String _offsetColumn;
- // name of the virtual column that we are going to store the validFrom value
to
- private final String _validFromColumn;
- // name of the virtual column that we are going to store the validUntil
value to
- private final String _validUntilColumn;
+ public static final String MODE_KEY = "mode";
- @JsonCreator
- public UpsertConfig(@JsonProperty(value = "primaryKeyColumns") List<String>
primaryKeyColumns,
- @JsonProperty(value = "offsetColumn") String offsetColumn,
- @JsonProperty(value = "validFromColumn") String validFromColumn,
- @JsonProperty(value = "validUntilColumn") String validUntilColumn) {
- Preconditions.checkArgument(primaryKeyColumns != null &&
primaryKeyColumns.size() == 1,
- "'primaryKeyColumns' must be configured with exact one column");
- Preconditions.checkArgument(StringUtils.isNotEmpty(offsetColumn),
"'offsetColumn' must be configured");
- Preconditions.checkArgument(StringUtils.isNotEmpty(validFromColumn),
"'validFromColumn' must be configured");
- Preconditions.checkArgument(StringUtils.isNotEmpty(validUntilColumn),
"'validUntilColumn' must be configured");
- _primaryKeyColumns = primaryKeyColumns;
- _offsetColumn = offsetColumn;
- _validFromColumn = validFromColumn;
- _validUntilColumn = validUntilColumn;
+ public enum Mode {
+ FULL, PARTIAL, NONE
Review comment:
In the implementation, it's more clearer (and easier) to have a value to
represent that upsert is disabled. Also, when UpsertConfig is null, it implies
the mode is `NONE`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]