Jackie-Jiang commented on code in PR #17536:
URL: https://github.com/apache/pinot/pull/17536#discussion_r2718597633
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/offline/DimensionTableDataManager.java:
##########
@@ -332,6 +343,16 @@ private DimensionTable createMemOptimisedDimensionTable() {
this);
}
+ private void sortSegmentsForUpsert(List<SegmentDataManager>
segmentDataManagers) {
+ if (!_enableUpsert) {
Review Comment:
(minor) Put this check on the caller side
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/offline/DimensionTableDataManager.java:
##########
@@ -320,7 +325,13 @@ private DimensionTable createMemOptimisedDimensionTable() {
Object[] primaryKey = recordReader.getRecordValues(i, pkIndexes);
long readerIdxAndDocId = (((long) readerIdx) << 32) | (i &
0xffffffffL);
+ boolean hasExistingKey = lookupTable.containsKey(primaryKey);
Review Comment:
Is this a bugfix? We can check the return value of `lookupTable.put()` to
save one map lookup
##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/DimensionTableConfig.java:
##########
@@ -26,12 +26,23 @@
public class DimensionTableConfig extends BaseJsonConfig {
private final boolean _disablePreload;
private final boolean _errorOnDuplicatePrimaryKey;
+ private final boolean _enableUpsert;
@JsonCreator
public DimensionTableConfig(@JsonProperty(value = "disablePreload") Boolean
disablePreload,
- @JsonProperty(value = "errorOnDuplicatePrimaryKey") Boolean
errorOnDuplicatePrimaryKey) {
+ @JsonProperty(value = "errorOnDuplicatePrimaryKey") Boolean
errorOnDuplicatePrimaryKey,
Review Comment:
(minor) Not introduced in this PR, but can we modify all of them to be
primitive type given the member variables are stored as primitive boolean
--
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]