Support nested json schema in realtime ingest
Hi forks,
Does the streaming ingest function support the nested json schema, e.g.
{
"a": {
"b": "xxx"
}
}
Is there a way like this in the schema statement: "a.b" is a string
Thanks
Do you want the column name to be a.b and value xxx?
Do you want the column name to be a.b and value xxx?
yes, sir
Also does the kafka realtime ingest part have resource control? e.g. how many consumer thread
For the json field, you can configure it as string field in the schema, and enable json index for it (Check https://docs.pinot.apache.org/basics/indexing/json-index for more details)
Note that the input data needs to be json strings. You may use jsonFormat() function to convert object to json string if needed.
For Kafka real-time ingestion, each Kafka partition is consumed by one thread (one consuming segment), and you can configure multiple replications of the segment
For the json field, you can configure it as string field in the schema, and enable json index for it (Check https://docs.pinot.apache.org/basics/indexing/json-index for more details) Note that the input data needs to be json strings. You may use
jsonFormat()function to convert object to json string if needed.
For Kafka real-time ingestion, each Kafka partition is consumed by one thread (one consuming segment), and you can configure multiple replications of the segment
Thanks for the reply! I check the link that you posted. If the upstream data is in nested json, like this: {"props":{"name":"tom"}}, can data be stored in a column field like 'name' WITHOUT nested 'props'?
I don't quite understand. Suppose the upstream Kafka topic has 10 partitions, and I want to configure 2 consumer threads. Question 1, where to config the setting. Question 2. If lag happens, I want to increase to 10 threads, how to change the setting
Yes. You can create a column “name” and use a transform function
see json functions here https://docs.pinot.apache.org/users/user-guide-query/supported-transformations
We create one thread per partition automatically.