UBOdin / mimir

Data-ish exploration through SQL+Uncertainty
http://mimirdb.info
Apache License 2.0
27 stars 13 forks source link

JSON Type #333

Open okennedy opened 5 years ago

okennedy commented 5 years ago

Spark natively supports nested data a'la JSON. There's enough going on in Mimir that uses JSON that it might make sense to add native support for Json (i.e., TJson(), JsonPrimitive(scala.play.json.JsValue) and support for Json primitives in the SQL parser - #119).

okennedy commented 5 years ago

Possibly useful for supporting #212

okennedy commented 5 years ago
okennedy commented 5 years ago

It's possible that what we want is actually Map/Array types instead (paralleling Spark's Map/Array types)

willspoth commented 5 years ago

I think the lens interface will do exactly what we want:

Create Lens mydata 
AS Select row_id, jsonCol from jsonDataset
With (row_id Int,{JSON-Schemas}); // these would handle column definitions outside of the json

Then to query mydata do SELECT row_id, $.name, $.pharmacy.* FROM mydata This could handle un-nest, and could even use generic column regex instead of only being json syntax