egalpin commented on code in PR #10234: URL: https://github.com/apache/pinot/pull/10234#discussion_r1123512336
########## pinot-spi/src/main/java/org/apache/pinot/spi/config/table/UpsertConfig.java: ########## @@ -154,10 +136,26 @@ public void setDefaultPartialUpsertStrategy(Strategy defaultPartialUpsertStrateg * same primary key, the record with the larger value of the time column is picked as the * latest update. * However, there are cases when users need to use another column to determine the order. - * In such case, you can use option comparisonColumn to override the column used for comparison. + * In such case, you can use option comparisonColumn to override the column used for comparison. When using + * multiple comparison columns, typically in the case of partial upserts, it is expected that input documents will + * each only have a singular non-null comparisonColumn. Multiple non-null values in an input document _will_ result + * in undefined behaviour. Typically, one comparisonColumn is allocated per distinct producer application of data + * in the case where there are multiple producers sinking to the same table. */ + public void setComparisonColumns(List<String> comparisonColumns) { + Preconditions.checkArgument(_comparisonColumns == null || !comparisonColumns.isEmpty(), + "Possible duplicated entries: comparisonColumn, comparisonColumns"); + _comparisonColumns = comparisonColumns; + } + + public void setComparisonColumn(List<String> comparisonColumns) { + Preconditions.checkArgument(comparisonColumns == null || !comparisonColumns.isEmpty(), + "Possible duplicated entries: comparisonColumn, comparisonColumns"); + _comparisonColumns = comparisonColumns; + } + Review Comment: Removed. I originally had this here to allow for using either `comparisonColumn` or `comparisonColumns` interchangeably, but that's probably less clear than enforcing String with one, and List<String> for the other. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org