Company or project name
ClickHouse
Use case
Right now during new JSON type parsing an array of different data types is inferred as an unnamed tuple:
:) select JSONAllPathsWithTypes('{"a" : ["Hello", 1, [1, 2, 3]]}'::JSON)
SELECT JSONAllPathsWithTypes(CAST('{"a" : ["Hello", 1, [1, 2, 3]]}', 'JSON'))
Query id: 0af75119-32bc-4224-b07e-c67e3de422fe
┌─JSONAllPathsWithTypes(CAST('{"a" : ["Hello", 1, [1, 2, 3]]}', 'JSON'))───┐
1. │ {'a':'Tuple(Nullable(String), Nullable(Int64), Array(Nullable(Int64)))'} │
└──────────────────────────────────────────────────────────────────────────┘
But working with unnamed tuples is really difficult, especially when you need to iterate over its fields. It would be better to infer type Array(Dynamic) in this case.
Describe the solution you'd like
:) select JSONAllPathsWithTypes('{"a" : ["Hello", 1, [1, 2, 3]]}'::JSON)
SELECT JSONAllPathsWithTypes(CAST('{"a" : ["Hello", 1, [1, 2, 3]]}', 'JSON'))
Query id: 0af75119-32bc-4224-b07e-c67e3de422fe
┌─JSONAllPathsWithTypes(CAST('{"a" : ["Hello", 1, [1, 2, 3]]}', 'JSON'))───┐
1. │ {'a':'Array(Dynamic)'} │
└──────────────────────────────────────────────────────────────────────────┘
Describe alternatives you've considered
No response
Additional context
No response