Open rjnn opened 4 years ago
Closing in favor of #2679.
You didn't actually close this. :D
Reopening! From https://github.com/MaterializeInc/materialize/issues/2679#issuecomment-614922357 by @benesch, the product ask is pretty clear. I've copy-and-pasted his comment here with some tweaks, so the following is straight up plagiarism:
We want support for statically determining types from a given JSON schema:
CREATE TYPE x (a int, b int);
SELECT * FROM json_populate_record(null::x, '{"a":1,"b":2}');
CREATE TYPE x FROM JSON SCHEMA '...';
SELECT * FROM json_populate_record(NULL::x, ...);
Crosslinking that #3516 is a precursor to this.
Filed for later, but relationalizing JSON feeds is manual and laborious. For instance, the recent changes wikimedia JSON feed ( https://stream.wikimedia.org/v2/stream/recentchange) has a JSONSchema field, which we could use to autopopulate columns. Without that, I had to slowly construct this view definition by hand:
Which isn't the end of the world, but JSON schema would alleviate this.
Filed for later.