`DATA:` `{ "id":1, "person" : [{"firstName" : "J...
# troubleshooting
a
DATA:
{  "id":1, "person" : [{"firstName" : "John","lastName" : "Smith"  },{"firstName" : "Jai","lastName" : "hanuman"}],  "last_login" : 1620150498000}
• Table Schema
{
"schemaName": "user_stream_primary",
"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"
}
],
"primaryKeyColumns": [
"id"
]
}
Even tho I am using primary key as ID still I can see extra data in it. @Mayank @Xiang Fu
x
Try this table config:
Copy code
{
  "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)"
      }
    ]
  },
  "upsertConfig": {
    "mode": "FULL"
  },
  "isDimTable": false
}
a
hi @Xiang Fu you have not mentioned primary key here in the config the above configuration in upsert mode is below and it doesnt work please check
{
"REALTIME": {
"tableName": "user_stream_primary_REALTIME",
"tableType": "REALTIME",
"segmentsConfig": {
"timeColumnName": "last_login",
"minimizeDataMovement": false,
"schemaName": "user_stream_primary",
"replication": "2",
"replicasPerPartition": "2"
},
"tenants": {
"broker": "DefaultTenant",
"server": "DefaultTenant",
"tagOverrideConfig": {}
},
"tableIndexConfig": {
"autoGeneratedInvertedIndex": false,
"enableDynamicStarTreeCreation": false,
"columnMajorSegmentBuilderEnabled": true,
"optimizeDictionaryForMetrics": false,
"noDictionarySizeRatioThreshold": 0.85,
"varLengthDictionaryColumns": [],
"rangeIndexVersion": 2,
"loadMode": "MMAP",
"streamConfigs": {
"streamType": "kafka",
"stream.kafka.topic.name": "user_stream_primary",
"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"
},
"enableDefaultStarTree": false,
"aggregateMetrics": false,
"nullHandlingEnabled": false,
"optimizeDictionary": false,
"onHeapDictionaryColumns": [],
"rangeIndexColumns": [],
"sortedColumn": [],
"bloomFilterColumns": [],
"invertedIndexColumns": [],
"noDictionaryColumns": [],
"createInvertedIndexDuringSegmentGeneration": false
},
"metadata": {},
"quota": {},
"routing": {
"instanceSelectorType": "strictReplicaGroup"
},
"query": {},
"upsertConfig": {
"mode": "FULL",
"defaultPartialUpsertStrategy": "OVERWRITE",
"upsertViewRefreshIntervalMs": 3000,
"hashFunction": "NONE",
"enablePreload": false,
"consistencyMode": "NONE",
"enableSnapshot": false,
"metadataTTL": 0,
"deletedKeysTTL": 0,
"dropOutOfOrderRecord": false,
"allowPartialUpsertConsumptionDuringCommit": false
},
"ingestionConfig": {
"continueOnError": false,
"rowTimeValueCheck": false,
"transformConfigs": [
{
"columnName": "userstr",
"transformFunction": "json_format(person)"
}
],
"segmentTimeValueCheck": true
},
"isDimTable": false
}
}
x
you specified the primary key as
id
in the schema right
a
Yesssss
Please try out the quickstart and edit to achieve what you want
that would be simpler 🙂