mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Fix
This commit is contained in:
parent
4c675f0151
commit
01684ad05a
@ -17,22 +17,17 @@ namespace DB
|
||||
bool ParserJSONPathMemberAccess::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
{
|
||||
if (pos->type != TokenType::Dot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
++pos;
|
||||
|
||||
if (pos->type != TokenType::BareWord)
|
||||
{
|
||||
if (pos->type != TokenType::BareWord && pos->type !=TokenType::QuotedIdentifier)
|
||||
return false;
|
||||
}
|
||||
|
||||
ParserIdentifier name_p;
|
||||
ASTPtr member_name;
|
||||
if (!name_p.parse(pos, member_name, expected))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto member_access = std::make_shared<ASTJSONPathMemberAccess>();
|
||||
node = member_access;
|
||||
|
@ -9,6 +9,7 @@ null
|
||||
|
||||
|
||||
|
||||
"bar"
|
||||
--JSON_QUERY--
|
||||
[{"hello":1}]
|
||||
[1]
|
||||
|
@ -11,6 +11,7 @@ SELECT JSON_VALUE('{"hello":["world","world2"]}', '$.hello');
|
||||
SELECT JSON_VALUE('{"hello":{"world":"!"}}', '$.hello');
|
||||
SELECT JSON_VALUE('{hello:world}', '$.hello'); -- invalid json => default value (empty string)
|
||||
SELECT JSON_VALUE('', '$.hello');
|
||||
SELECT JSON_VALUE('{"foo foo":"bar"}', '$."foo foo"');
|
||||
|
||||
SELECT '--JSON_QUERY--';
|
||||
SELECT JSON_QUERY('{"hello":1}', '$');
|
||||
|
Loading…
Reference in New Issue
Block a user