Fix crash in ObjectJson parsing array with nulls

This commit is contained in:
vdimir 2024-03-14 11:31:53 +00:00
parent 948ec2ba86
commit 6b954fcfd4
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
4 changed files with 8 additions and 1 deletions

View File

@ -1001,6 +1001,11 @@ Field FieldVisitorFoldDimension::operator()(const Array & x) const
return res;
}
Field FieldVisitorFoldDimension::operator()(const Null &) const
{
return Array();
}
void setAllObjectsToDummyTupleType(NamesAndTypesList & columns)
{
for (auto & column : columns)

View File

@ -139,7 +139,7 @@ public:
Field operator()(const Array & x) const;
Field operator()(const Null & x) const { return x; }
Field operator()(const Null & x) const;
template <typename T>
Field operator()(const T & x) const

View File

@ -16,3 +16,4 @@
{"x":[[],[1,2]]}
{"x":[[],[[1],[2]]]}
{"x":[[],[[],[2]]]}
{"a.a":[[1],[]]}

View File

@ -32,3 +32,4 @@ SELECT CAST('{"x" : [ 1 , [ 1 , 2] ]}', 'Object(\'json\')');
SELECT CAST('{"x" : [ {} , [ 1 , 2] ]}', 'Object(\'json\')');
SELECT CAST('{"x" : [ {} , [ 1 , [2]] ]}', 'Object(\'json\')');
SELECT CAST('{"x" : [ {} , [ {} , [2]] ]}', 'Object(\'json\')');
SELECT CAST(' {"a": { "a": [ [1], null ] } }', 'Object(Nullable(\'json\'))');