mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 04:52:10 +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};
|
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;
|
pos = next_pos;
|
||||||
}
|
}
|
||||||
|
@ -345,6 +345,18 @@ WITH
|
|||||||
SELECT
|
SELECT
|
||||||
x;
|
x;
|
||||||
{'argument1':'1','argument2':'2','char':'=','char2':'=','formula':'1+2=3','result':'3','string':'foo=bar'}
|
{'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)
|
-- check str_to_map alias (it is case-insensitive)
|
||||||
WITH
|
WITH
|
||||||
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
||||||
|
@ -481,6 +481,18 @@ WITH
|
|||||||
SELECT
|
SELECT
|
||||||
x;
|
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)
|
-- check str_to_map alias (it is case-insensitive)
|
||||||
WITH
|
WITH
|
||||||
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
sTr_tO_mAp('name:neymar, age:31 team:psg,nationality:brazil') AS s_map,
|
||||||
|
Loading…
Reference in New Issue
Block a user