apache / apache/pinot

Partial upsert doesn't support new columns in the schema

Open
#9,771 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
189

Description

We noticed that when a partial upsert enabled table is reloaded with a new column in the schema, the upsert behavior is not honored for the new column. This can be reproduced deterministically and the likely cause is described below:

We keep a list of columns which need to be updated in `PartialUpsertHandler`.
```
// _column2Mergers maintains the mapping of merge strategies per columns.
private final Map _column2Mergers = new HashMap<>();
```

This is initialized during `RealtimeTableDataManager#doInit`. However, it is not updated when we reload the table. This leads to the realtime engine not being aware of the new column. Hence, it will not handle upsert for this column. This new column will look the same as if the table didn't not have upserts.

Thus, as of today, any new column will be ignored in partial upsert. We need to be enhance partial upsert to handle new columns in the schema.

cc: @KKcorps @Jackie-Jiang

Contributor guide

Open the contributing guide

Research direction

Start with RealtimeTableDataManager#doInit and the table reload path, then inspect PartialUpsertHandler and its _column2Mergers map. Reproduce the deterministic case where a reloaded schema adds a column, and verify that the new column receives the configured partial-upsert behavior after reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.