Aditya Verma
12/28/2024, 6:49 AM{
"REALTIME": {
"tableName": "user_stream_nested3_REALTIME",
"tableType": "REALTIME",
"segmentsConfig": {
"replicasPerPartition": "1",
"schemaName": "user_stream_nested3",
"replication": "1",
"timeColumnName": "last_login",
"minimizeDataMovement": false
},
"tenants": {
"broker": "DefaultTenant",
"server": "DefaultTenant",
"tagOverrideConfig": {}
},
"tableIndexConfig": {
"createInvertedIndexDuringSegmentGeneration": false,
"varLengthDictionaryColumns": [],
"optimizeDictionaryForMetrics": false,
"autoGeneratedInvertedIndex": false,
"enableDynamicStarTreeCreation": false,
"columnMajorSegmentBuilderEnabled": true,
"noDictionarySizeRatioThreshold": 0.85,
"nullHandlingEnabled": false,
"noDictionaryColumns": [],
"bloomFilterColumns": [],
"invertedIndexColumns": [],
"onHeapDictionaryColumns": [],
"rangeIndexColumns": [],
"sortedColumn": [],
"rangeIndexVersion": 2,
"optimizeDictionary": false,
"streamConfigs": {
"streamType": "kafka",
"stream.kafka.topic.name": "user_stream_primary_nested",
"stream.kafka.broker.list": "localhost:9092",
"stream.kafka.consumer.type": "lowlevel",
"stream.kafka.consumer.prop.auto.offset.reset": "smallest",
"stream.kafka.consumer.factory.class.name": "org.apache.pinot.plugin.stream.kafka20.KafkaConsumerFactory",
"stream.kafka.decoder.class.name": "org.apache.pinot.plugin.stream.kafka.KafkaJSONMessageDecoder",
"realtime.segment.flush.threshold.rows": "0",
"realtime.segment.flush.threshold.segment.rows": "0",
"realtime.segment.flush.threshold.time": "24h",
"realtime.segment.flush.threshold.segment.size": "100M"
},
"aggregateMetrics": false,
"enableDefaultStarTree": false,
"loadMode": "MMAP"
},
"metadata": {},
"quota": {},
"routing": {},
"query": {},
"ingestionConfig": {
"continueOnError": false,
"rowTimeValueCheck": false,
"segmentTimeValueCheck": true,
"transformConfigs": [
{
"columnName": "userstr",
"transformFunction": "json_format(person)"
}
]
},
"isDimTable": false
}
}
Above is my table configs is a real time table
below is the schema
{
"schemaName": "user_stream_nested3",
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"name": "id",
"dataType": "INT",
"notNull": true
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}
Before in table config:
},
"isDimTable": false
}
after adding primary key configs and full upsert I am getting this error please help
},"isDimTable": false,
"primaryKeyColumns": ["id"],
"upsertConfig": {"mode": "FULL"}
}
ERROR:
Invalid table config: user_stream_nested3_REALTIME with error: Upsert/Dedup table must have primary key columns in the schema
Please help me solve itFasih Khatib
12/28/2024, 6:57 AMFasih Khatib
12/28/2024, 6:59 AMAditya Verma
12/28/2024, 7:09 AMFasih Khatib
12/28/2024, 7:11 AMtable must have primary key columns in the schemaYou'll have to update the JSON of your schema and add the primary key there. It's a part of the schema JSON rather than table JSON.
Fasih Khatib
12/28/2024, 7:11 AMAditya Verma
12/28/2024, 7:12 AM{
"schemaName": "user_stream_nested3",
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"name": "id",
"dataType": "INT",
"notNull": true
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}Aditya Verma
12/28/2024, 7:12 AMFasih Khatib
12/28/2024, 7:12 AMFasih Khatib
12/28/2024, 7:13 AMAditya Verma
12/28/2024, 7:14 AM{
"schemaName": "user_stream_nested3",
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"name": "id",
"dataType": "INT",
"notNull": true
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
},
{
"primaryKeyColumns": [
"event_id"
]
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}Aditya Verma
12/28/2024, 7:14 AMFasih Khatib
12/28/2024, 7:14 AMAditya Verma
12/28/2024, 7:15 AM{
"name": "id",
"dataType": "INT",
"notNull": true
}
this is my primary columnAditya Verma
12/28/2024, 7:15 AMFasih Khatib
12/28/2024, 7:15 AM{
"primaryKeyColumns": ["id"],
... rest of your schema ...
}Aditya Verma
12/28/2024, 7:16 AMAditya Verma
12/28/2024, 7:16 AM{
"schemaName": "user_stream_nested3",
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"primaryKeyColumns": ["id"]
},
{
"name": "id",
"dataType": "INT",
"notNull": false
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}
]
}Aditya Verma
12/28/2024, 7:17 AMAditya Verma
12/28/2024, 7:17 AMFasih Khatib
12/28/2024, 7:18 AMschemaName.Aditya Verma
12/28/2024, 7:20 AM{
"schemaName": "user_stream_nested3",
"primaryKeyColumns": ["id"],
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"name": "id",
"dataType": "INT",
"notNull": false
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}
]
}Aditya Verma
12/28/2024, 7:20 AMFasih Khatib
12/28/2024, 7:21 AMAditya Verma
12/28/2024, 7:22 AM},
"isDimTable": false
}
what does it actually does ?Aditya Verma
12/28/2024, 7:24 AMFasih Khatib
12/28/2024, 8:05 AMisDimTable and other fields used in the table configuration here. https://docs.pinot.apache.org/configuration-reference/tablehttps://docs.pinot.apache.org/configuration-reference/tableFasih Khatib
12/28/2024, 8:05 AMAditya Verma
12/28/2024, 9:46 AMAditya Verma
12/28/2024, 9:47 AMFasih Khatib
12/28/2024, 10:12 AM