Im trying to ingest data from a json file and generate new columns with transformed data.
Im trying to do sth like that but cannot find the way to solve it.
.create table example ingestion json mapping "example_mapping"
'['
'{ "column":"timestamp", "Properties": {"Path":"$.timestamp"}},'
'{ "column":"rawValue", "Properties":{"Path":"$.rawValue"}},'
'{ "column":"Name", "Properties":{"Path":"$.Name"}},'
'{ "column":"Name1", "Properties":{"ConstantValue":"$.split(Name, "_")[1]"}},'
'{ "column":"Name2", "Properties":{"Path":"$[\' split(Name, "_")[1]\']"}},'
'{ "column":"Name3", "Properties":{"Path":"$[\' split(Name, "_")[2]\']"}},'
'{ "column":"Name4", "Properties":{"Path":"$[\' split(Name, "_")[3]\']"}},'
'{ "column":"Name5", "Properties":{"Path":"$[\' split(Name, "_")[4]\']"}},'
'{ "column":"Name6", "Properties":{"Path":"$[\' split(Name, "_")[5]\']"}},'
'{ "column":"Name7", "Properties":{"Path":"$[\' split(Name, "_")[6]\']"}},'
'{ "column":"Name8", "Properties":{"Path":"$[\' split(Name, "_")[7]\']"}},'
'{ "column":"RelevantData", "Properties":{"Path":"$[\'RelevantData\']"}}'
']'
Name1, 2, 3, 4... are the new columns and Im trying to do a splitsplit(Name, "_")[0]
in order to make the transformation in th eingestion mapping.
¿Anybody knows if this is possible? Advice would be welcome. Thanks