good first issuetype/feature-requestversion:3.2.9version:3.3.0version:3.4
Metriche repository
- Star
- (5717 star)
- Metriche merge PR
- (Merge medio 1g 5h) (1000 PR mergiate in 30 g)
Descrizione
- https://github.com/StarRocks/starrocks/pull/47233
- https://github.com/StarRocks/starrocks/pull/46448
- https://github.com/StarRocks/starrocks/pull/45406
Feature request
Is your feature request related to a problem? Please describe.
STRUCT type is more performant that JSON in terms of query, but which use the fixed schema and annoying to construct.
If it's possible to convert JSON to STRUCT directly, like to_struct(JSON), it can be much easier to use.
Describe the solution you'd like
- Use a function to convert JSON to STRUCT:
- Example:
select to_struct(parse_json("{"a": 1}")) - Difficulty: cannot inference the schema of struct before parsing the JSON
- Example:
- Specify the STRUCT schema and convert:
- Example:
select to_struct<a int, b int>(parse_json("a": 1, "b": 2)) - Difficulty: not easy to use
- Example:
Describe alternatives you've considered
Additional context