mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: added support for whitespaces when parsing arrays [#METR-14798].
This commit is contained in:
parent
91b10d0820
commit
684b2e70a9
@ -165,8 +165,15 @@ void DataTypeArray::deserializeText(Field & field, ReadBuffer & istr) const
|
|||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
|
skipWhitespaceIfAny(istr);
|
||||||
|
|
||||||
|
if (*istr.position() == ']')
|
||||||
|
break;
|
||||||
|
|
||||||
arr.push_back(Field());
|
arr.push_back(Field());
|
||||||
nested->deserializeTextQuoted(arr.back(), istr);
|
nested->deserializeTextQuoted(arr.back(), istr);
|
||||||
|
|
||||||
|
skipWhitespaceIfAny(istr);
|
||||||
}
|
}
|
||||||
assertString("]", istr);
|
assertString("]", istr);
|
||||||
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
[] [] []
|
||||||
|
[] [] []
|
||||||
|
[] [] []
|
||||||
|
[] [] [[]]
|
||||||
|
[] [] [[],[]]
|
||||||
|
[] [] [['2015-01-01','2015-01-02'],['2015-01-03','2015-01-04']]
|
||||||
|
[] ['Hello','World'] []
|
||||||
|
[1,2] [] []
|
||||||
|
[3,4] [] []
|
||||||
|
[5,6] [] []
|
||||||
|
[7,8] [] []
|
10
dbms/tests/queries/0_stateless/00117_parsing_arrays.sql
Normal file
10
dbms/tests/queries/0_stateless/00117_parsing_arrays.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
DROP TABLE IF EXISTS test.null;
|
||||||
|
CREATE TABLE test.null (a Array(UInt64), b Array(String), c Array(Array(Date))) ENGINE = Memory;
|
||||||
|
|
||||||
|
INSERT INTO test.null (a) VALUES ([1,2]), ([3, 4]), ([ 5 ,6]), ([ 7 , 8 ]), ([]), ([ ]);
|
||||||
|
INSERT INTO test.null (b) VALUES ([ 'Hello' , 'World' ]);
|
||||||
|
INSERT INTO test.null (c) VALUES ([ ]), ([ [ ] ]), ([[],[]]), ([['2015-01-01', '2015-01-02'], ['2015-01-03', '2015-01-04']]);
|
||||||
|
|
||||||
|
SELECT a, b, c FROM test.null ORDER BY a, b, c;
|
||||||
|
|
||||||
|
DROP TABLE test.null;
|
Loading…
Reference in New Issue
Block a user