Hey, I recently started using pinot and facing an ...
# troubleshooting
k
Hey, I recently started using pinot and facing an issue with ingesting data with JSON column. I have marked the column as JSON data type in schema and have used JSON index for the column as well. But when I query the data, I get null value for the entire JSON column. Where did I go wrong?
m
Hey - no tsure, you'll have to give a bit more information. e.g • How are you importing the data? • What do you table config/schema look like?
k
I am importing the data through batch ingestion from standalone machine.
m
ok cool. So you said you get rows returned but they're empty? Can you share the ingestion job spec + a sample of the CSV file that you're ingesting?
k
m4_ver2_check.json,m4_ver2_ingestion.yaml
Yes the values returned are null, when I try querying the data.
m
Thanks. Pinot tries to map the column name in the schema to a field name in each JSON document. So you would need to create a key called
sample
to have this work. If you update your JSON file to read like this:
Copy code
{"sample": {"name":{"first":"daffy","last":"duck"},"score":101,"data":["a","b","c","d"]}}
{"sample": {"name":{"first":"donald","last":"duck"},"score":102,"data":["a","b","e","f"]}}
{"sample": {"name":{"first":"mickey","last":"mouse"} ,"score":103 ,"data":["a" ,"b" ,"g" ,"h"]}}
{"sample": {"name":{"first":"minnie" ,"last":"mouse"} ,"score":104 ,"data":["a" ,"b" ,"i" ,"j"]}}
{"sample": {"name":{"first":"goofy" ,"last":"dwag"} ,"score":104 ,"data":["a" ,"b" ,"i" ,"j"]}}
{"sample": {"person":{"name":"daffy duck" ,"companies":[{"name":"n1" ,"title":"t1"} ,{"name":"n2" ,"title":"t2"}]}}}
{"sample": {"person":{"name":"scrooge mcduck" ,"companies":[{"name":"n1" ,"title":"t1"} ,{"name":"n2" ,"title":"t2"}]}}}
and then run the ingestion job again