rohityadav1993 commented on code in PR #11584:
URL: https://github.com/apache/pinot/pull/11584#discussion_r1343656583
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/PartialUpsertHandler.java:
##########
@@ -41,16 +44,33 @@ public class PartialUpsertHandler {
private final PartialUpsertMerger _defaultPartialUpsertMerger;
private final List<String> _comparisonColumns;
private final List<String> _primaryKeyColumns;
+ private final PartialUpsertRowMergeEvaluator _rowMerger;
+ private LazyRow _reusePreviousLazyRow;
+ private LazyRow _reuseNewLazyRow;
+ private Map<String, Object> _reuseRowMergerResult;
- public PartialUpsertHandler(Schema schema, Map<String,
UpsertConfig.Strategy> partialUpsertStrategies,
- UpsertConfig.Strategy defaultPartialUpsertStrategy, List<String>
comparisonColumns) {
- _defaultPartialUpsertMerger =
PartialUpsertMergerFactory.getMerger(defaultPartialUpsertStrategy);
+ public PartialUpsertHandler(Schema schema, UpsertConfig upsertConfig,
List<String> comparisonColumns) {
+ _defaultPartialUpsertMerger =
PartialUpsertMergerFactory.getMerger(upsertConfig.getDefaultPartialUpsertStrategy());
_comparisonColumns = comparisonColumns;
_primaryKeyColumns = schema.getPrimaryKeyColumns();
- for (Map.Entry<String, UpsertConfig.Strategy> entry :
partialUpsertStrategies.entrySet()) {
+ for (Map.Entry<String, UpsertConfig.Strategy> entry :
upsertConfig.getPartialUpsertStrategies().entrySet()) {
_column2Mergers.put(entry.getKey(),
PartialUpsertMergerFactory.getMerger(entry.getValue()));
}
+
+ String rowMergerCustomImplementation =
upsertConfig.getRowMergerCustomImplementation();
+ if (rowMergerCustomImplementation != null &&
!rowMergerCustomImplementation.equals("")) {
+ try {
+ _rowMerger =
PartialUpsertRowMergeEvaluatorFactory.getInstance(rowMergerCustomImplementation);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ _reusePreviousLazyRow = new LazyRow();
+ _reuseNewLazyRow = new LazyRow();
+ _reuseRowMergerResult = new HashMap<>();
Review Comment:
Should not be needed since this is per partition.
--
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]