Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Type #333

Open
okennedy opened this issue Jul 14, 2019 · 4 comments
Open

JSON Type #333

okennedy opened this issue Jul 14, 2019 · 4 comments

Comments

@okennedy
Copy link
Member

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
Copy link
Member Author

Possibly useful for supporting #212

@okennedy
Copy link
Member Author

  • Add a new type / primitive
  • Update the typechecker
  • Figure out how this plugs into Spark's handling of JSON / nested data. (e.g., we should be able to use Spark's JSON functions to interact with this new type.

@okennedy
Copy link
Member Author

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

@willspoth willspoth pinned this issue Jul 31, 2019
@willspoth
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants