Home > Blockchain >  how to use ingestion inline write a Json into a table and not use the comma as a splitter in the Jso
how to use ingestion inline write a Json into a table and not use the comma as a splitter in the Jso

Time:07-21

I want to write below value into table use ingestion inline.

.ingest inline into table Purchases1 <|
{"19node_0x0101010002":{"values":{"nodeValue":"11139","timestampTssReceived":"2022-07-20T09:13:18.4590000Z"}}},xxx,30

but the json will be split by comma like below resalt, if have some approach to avoid the comma as splitter in this json?

.create table Purchases2 (name: dynamic, country: string, age: long)

Purchases2

enter image description here

CodePudding user response:

As can be seen in the documentation (ingest inline command (push)), inline ingestion supports with ( IngestionPropertyName = IngestionPropertyValue [, ...] )

You could ingest the data as json or as other delimited format such as psv

PSV
.ingest inline into table Purchases with (format = "psv") <|
{"19node_0x0101010002":{"values":{"nodeValue":"11139","timestampTssReceived":"2022-07-20T09:13:18.4590000Z"}}}|xxx|30
JSON
.ingest inline into table Purchases with (format = "json") <|
{"name": {"19node_0x0101010002":{"values":{"nodeValue":"11139","timestampTssReceived":"2022-07-20T09:13:18.4590000Z"}}}, "country": "xxx", "age": 30}
  • Related