JSON SQL Support #85
jacksonrnewhouse
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've started writing out some initial JSON functions. Handling JSON in sql is not very well standardized, DataFusion doesn't really have any json functions yet and there are a number of different approaches out there.
Postgres JSON
Postgres has a combination of syntax and functions that allow for incredibly extensive manipulation and querying of json objects. Because of how much syntax plays a role going this route would require big changes to the sql grammar. https://www.postgresql.org/docs/current/functions-json.html
Spark SQL
Spark also has a native json type, and supports conversions between strings and structs. It's all handled via functions and data types, so would be easier to make work with DataFusion. The get_json_object() function is one of the primary extractors.
Calcite SQL
Calcite, which is used by many Java SQL projects, including Flink SQL and Druid SQ. It does incorporate in the grammar so has some similar issues as Postgres, but it is a less extensive set of changes. They also allow for a lot of expressiveness around handling exceptions/nulls/return types etc. Calcite documentation, Flink SQL.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions