Apache Pinot Docs
Search…
latest
TOJSONMAPSTR
This section contains reference documentation for the TOJSONMAPSTR function.
Convert map to JSON String. This function can only be used in an ingestion transformation function.

Signature

TOJSONMAPSTR(map)

Usage Examples

The usage examples are based on extracting fields from the following JSON document:
1
{"timestamp": "2019-10-09 21:25:25", "meta": {"age": 12}}
Copied!
Expression
Value
TOJSONMAPSTR(meta)
"{\"age\":12}"
This function can be used in the table config to extract the meta property into the data column, as described below:
1
{
2
"tableConfig":{
3
"ingestionConfig":{
4
"transformConfigs":[
5
{
6
"columnName":"data",
7
"transformFunction":"TOJSONMAPSTR(meta)"
8
}
9
]
10
}
11
}
12
}
Copied!
Copy link