Metadata TTL Upsert Config Realtime table ```Sinc...
# troubleshooting
j
Metadata TTL Upsert Config Realtime table
Copy code
Since the metadata TTL is applied on the first comparison column, the time unit of upsert TTL is the same as the first comparison column.
Here is my upsert config
Copy code
"upsertConfig": {
    "enablePreload": true,
    "dropOutOfOrderRecord": false,
    "mode": "FULL",
    "comparisonColumns": [
      "Last_Replication_Date"
    ],
    "hashFunction": "MURMUR3",
    "defaultPartialUpsertStrategy": "OVERWRITE",
    "enableSnapshot": true,
    "metadataTTL": 5184000000,
    "deletedKeysTTL": 0
  },
Here is my scema
Copy code
{
  "name": "Last_Replication_Date",
  "dataType": "LONG",
  "notNull": false,
  "format": "1:MILLISECONDS:EPOCH",
  "granularity": "1:MILLISECONDS"
}
I have couple of questions 1. As you can see my
Last_Replication_Date
column is nullable for many old records, how does that effect
metadataTTL
? 2. Does setting
dropOutOfOrderRecord:true
have negative impact on memory consumtion?
m
1. Comparison column should not be null, you will get undesired side effects based on the default null value. 2. I don't see why it should have negative impact on memory. What are you speculating?
j
So in the current usecase I am not able to avoid having the Commparison column to be null and its default value is
-9223372036854775808
and my metadataTTL is
5184000000
so by logic default value + metadataTTL should expire immediately right? If not for this default value do you suggest anything else? @Mayank @Xiang Fu
x
can you try to make default value to
now()
if it’s null?
j
keeping it to
now()
will not expire the metadata TTL right? so the problem is I am running out of heap memory.
x
make a transform column say
ts_comp
, in the ingestion config, configure it to be if null then now() else keep itself. Then pinot will use ingestion time for timestamp comparison
the event will expire after 60 days
downside is when you re-ingest data, they will use new timestamp , but in theory you don’t know timestamp, so not much to do here other than use ingestion time.
j
So for those records for which the
Last_Replication_Date
is null they wont have any updates so I dont want them to be in upsert metadata. So setting it to very old date will do it right?
x
i see
then you just make scheme change for the timestamp column of the default value to be int max then they will never expire
j
I want them to be expired on insert, since I dont see any updates coming for those records so I have do it to int min right?
x
in short we have to track all the keys otherwise we don’t know how to upsert when the new row is coming
unless you can ensure there are no upsert for those keys then you can build a separated immutable segments and push as OFFLINE table