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:

{"timestamp": "2019-10-09 21:25:25", "meta": {"age": 12}}
ExpressionValue

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:

{
   "tableConfig":{
      "ingestionConfig":{
         "transformConfigs":[
            {
               "columnName":"data",
               "transformFunction":"TOJSONMAPSTR(meta)"
            }
         ]
      }
   }
}