mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #53470 from KevinyhZou/bug_fix_json_query_path_numberic
Fix JSON_QUERY Function parse error while path is all number
This commit is contained in:
commit
8e6b8fc2d0
@ -58,6 +58,10 @@ bool ParserJSONPathMemberAccess::parseImpl(Pos & pos, ASTPtr & node, Expected &
|
||||
member_name = std::make_shared<ASTIdentifier>(String(last_begin, pos->end));
|
||||
++pos;
|
||||
}
|
||||
else if (!pos.isValid() && pos->type == TokenType::EndOfStream)
|
||||
{
|
||||
member_name = std::make_shared<ASTIdentifier>(String(last_begin, last_end));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@ -77,6 +77,10 @@ SELECT JSON_QUERY('{"array":[[0, 1, 2, 3, 4, 5], [0, -1, -2, -3, -4, -5]]}', '$.
|
||||
[0, 1, 4, 0, -1, -4]
|
||||
SELECT JSON_QUERY('{"1key":1}', '$.1key');
|
||||
[1]
|
||||
SELECT JSON_QUERY('{"123":1}', '$.123');
|
||||
[1]
|
||||
SELECT JSON_QUERY('{"123":1}', '$[123]');
|
||||
|
||||
SELECT JSON_QUERY('{"hello":1}', '$[hello]');
|
||||
[1]
|
||||
SELECT JSON_QUERY('{"hello":1}', '$["hello"]');
|
||||
|
@ -43,6 +43,8 @@ SELECT JSON_QUERY( '{hello:{"world":"!"}}}', '$.hello'); -- invalid json => defa
|
||||
SELECT JSON_QUERY('', '$.hello');
|
||||
SELECT JSON_QUERY('{"array":[[0, 1, 2, 3, 4, 5], [0, -1, -2, -3, -4, -5]]}', '$.array[*][0 to 2, 4]');
|
||||
SELECT JSON_QUERY('{"1key":1}', '$.1key');
|
||||
SELECT JSON_QUERY('{"123":1}', '$.123');
|
||||
SELECT JSON_QUERY('{"123":1}', '$[123]');
|
||||
SELECT JSON_QUERY('{"hello":1}', '$[hello]');
|
||||
SELECT JSON_QUERY('{"hello":1}', '$["hello"]');
|
||||
SELECT JSON_QUERY('{"hello":1}', '$[\'hello\']');
|
||||
|
Loading…
Reference in New Issue
Block a user