mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
add transition from reading key to reading quoted key when double quotes are found
This commit is contained in:
parent
a011990fd7
commit
e4400ec24c
@ -106,6 +106,11 @@ public:
|
||||
{
|
||||
return {next_pos, State::WAITING_KEY};
|
||||
}
|
||||
else if (isQuotingCharacter(*p))
|
||||
{
|
||||
// +1 to skip quoting character
|
||||
return {next_pos, State::READING_QUOTED_KEY};
|
||||
}
|
||||
|
||||
pos = next_pos;
|
||||
}
|
||||
|
@ -345,6 +345,18 @@ WITH
|
||||
SELECT
|
||||
x;
|
||||
{'argument1':'1','argument2':'2','char':'=','char2':'=','formula':'1+2=3','result':'3','string':'foo=bar'}
|
||||
-- https://github.com/ClickHouse/ClickHouse/issues/56357
|
||||
WITH
|
||||
extractKeyValuePairs('{"a":"1", "b":"2"}') as s_map,
|
||||
CAST(
|
||||
arrayMap(
|
||||
(x) -> (x, s_map[x]), arraySort(mapKeys(s_map))
|
||||
),
|
||||
'Map(String,String)'
|
||||
) AS x
|
||||
SELECT
|
||||
x;
|
||||
{'a':'1','b':'2'}
|
||||
-- check str_to_map alias (it is case-insensitive)
|
||||
WITH
|
||||
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
||||
|
@ -481,6 +481,18 @@ WITH
|
||||
SELECT
|
||||
x;
|
||||
|
||||
-- https://github.com/ClickHouse/ClickHouse/issues/56357
|
||||
WITH
|
||||
extractKeyValuePairs('{"a":"1", "b":"2"}') as s_map,
|
||||
CAST(
|
||||
arrayMap(
|
||||
(x) -> (x, s_map[x]), arraySort(mapKeys(s_map))
|
||||
),
|
||||
'Map(String,String)'
|
||||
) AS x
|
||||
SELECT
|
||||
x;
|
||||
|
||||
-- check str_to_map alias (it is case-insensitive)
|
||||
WITH
|
||||
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
||||
|
Loading…
Reference in New Issue
Block a user