`{` `"REALTIME": {` `"tableName": "user_stre...
# troubleshooting
a
{
"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 it
f
Primary keys are defined in the schema configuration.
a
@Fasih Khatib I did the same way and shows error can you go thru my error once and see
f
Hey @Aditya Verma, is says
table must have primary key columns in the schema
You'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.
I have it as a part of my schema and Pinot says it is fine.
a
Copy code
{
  "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"
    }
so you mean here this is the schema
f
Correct.
In Pinot, the schema and the table have their own JSON configurations. You can use the same schema to create offline and realtime tables.
a
can you edit it for me I have very less clue how to do it here .I can edit and show it to you
{
"schemaName": "user_stream_nested3",
"enableColumnBasedNullHandling": false,
"dimensionFieldSpecs": [
{
"name": "id",
"dataType": "INT",
"notNull": true
},
{
"name": "userstr",
"dataType": "STRING",
"notNull": false
},
Copy code
{
  "primaryKeyColumns": [
    "event_id"
  ]
}
],
"dateTimeFieldSpecs": [
{
"name": "last_login",
"dataType": "LONG",
"notNull": false,
"format": "1:MILLISECONDS:EPOCH",
"granularity": "1:MILLISECONDS"
}
someting liek this?
f
You just need to add primary key column as a top-level field.
a
{
"name": "id",
"dataType": "INT",
"notNull": true
}
this is my primary column
its alreadyt there in the schema
f
Copy code
{
  "primaryKeyColumns": ["id"],
  ... rest of your schema ...
}
a
ok let me change and show it to you
{
"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"
}
]
}
something like this?
apologies , i am pretty new to it so might create mistakes
f
Remove the braces. Add it just like you've added
schemaName
.
a
I think I got it
{
"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"
}
]
}
please check it if its correct now?
f
lgtm
a
thanks also wanted to know about this parameter
},
"isDimTable": false
}
what does it actually does ?
so after changing in table schema I need to mention it in table configs as well ?
f
You can find the documentation for
isDimTable
and other fields used in the table configuration here. https://docs.pinot.apache.org/configuration-reference/tablehttps://docs.pinot.apache.org/configuration-reference/table
No, primary key is only part of the schema configuration.
a
ok got it
thank you so much
f
🍷