mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Add test
This commit is contained in:
parent
194ce2d881
commit
ad637c6824
@ -113,7 +113,9 @@ def test_postgres_conversions(started_cluster):
|
||||
g Text[][][][][] NOT NULL, -- String
|
||||
h Integer[][][], -- Nullable(Int32)
|
||||
i Char(2)[][][][], -- Nullable(String)
|
||||
k Char(2)[] -- Nullable(String)
|
||||
j Char(2)[], -- Nullable(String)
|
||||
k UUID[], -- Nullable(UUID)
|
||||
l UUID[][] -- Nullable(UUID)
|
||||
)"""
|
||||
)
|
||||
|
||||
@ -123,15 +125,18 @@ def test_postgres_conversions(started_cluster):
|
||||
)
|
||||
expected = (
|
||||
"a\tArray(Date)\t\t\t\t\t\n"
|
||||
+ "b\tArray(DateTime64(6))\t\t\t\t\t\n"
|
||||
+ "c\tArray(Array(Float32))\t\t\t\t\t\n"
|
||||
+ "d\tArray(Array(Float64))\t\t\t\t\t\n"
|
||||
+ "e\tArray(Array(Array(Decimal(5, 5))))\t\t\t\t\t\n"
|
||||
+ "f\tArray(Array(Array(Int32)))\t\t\t\t\t\n"
|
||||
+ "g\tArray(Array(Array(Array(Array(String)))))\t\t\t\t\t\n"
|
||||
+ "h\tArray(Array(Array(Nullable(Int32))))\t\t\t\t\t\n"
|
||||
+ "i\tArray(Array(Array(Array(Nullable(String)))))\t\t\t\t\t\n"
|
||||
+ "k\tArray(Nullable(String))"
|
||||
"b\tArray(DateTime64(6))\t\t\t\t\t\n"
|
||||
"c\tArray(Array(Float32))\t\t\t\t\t\n"
|
||||
"d\tArray(Array(Float64))\t\t\t\t\t\n"
|
||||
"e\tArray(Array(Array(Decimal(5, 5))))\t\t\t\t\t\n"
|
||||
"f\tArray(Array(Array(Int32)))\t\t\t\t\t\n"
|
||||
"g\tArray(Array(Array(Array(Array(String)))))\t\t\t\t\t\n"
|
||||
"h\tArray(Array(Array(Nullable(Int32))))\t\t\t\t\t\n"
|
||||
"i\tArray(Array(Array(Array(Nullable(String)))))\t\t\t\t\t\n"
|
||||
"j\tArray(Nullable(String))\t\t\t\t\t\n"
|
||||
"k\tArray(Nullable(UUID))\t\t\t\t\t\n"
|
||||
"l\tArray(Array(Nullable(UUID)))"
|
||||
""
|
||||
)
|
||||
assert result.rstrip() == expected
|
||||
|
||||
@ -147,7 +152,9 @@ def test_postgres_conversions(started_cluster):
|
||||
"[[[[['winx', 'winx', 'winx']]]]], "
|
||||
"[[[1, NULL], [NULL, 1]], [[NULL, NULL], [NULL, NULL]], [[4, 4], [5, 5]]], "
|
||||
"[[[[NULL]]]], "
|
||||
"[]"
|
||||
"[], "
|
||||
"['2a0c0bfc-4fec-4e32-ae3a-7fc8eea6626a', '42209d53-d641-4d73-a8b6-c038db1e75d6', NULL], "
|
||||
"[[NULL, '42209d53-d641-4d73-a8b6-c038db1e75d6'], ['2a0c0bfc-4fec-4e32-ae3a-7fc8eea6626a', NULL], [NULL, NULL]]"
|
||||
")"
|
||||
)
|
||||
|
||||
@ -157,15 +164,17 @@ def test_postgres_conversions(started_cluster):
|
||||
)
|
||||
expected = (
|
||||
"['2000-05-12','2000-05-12']\t"
|
||||
+ "['2000-05-12 12:12:12.012345','2000-05-12 12:12:12.012345']\t"
|
||||
+ "[[1.12345],[1.12345],[1.12345]]\t"
|
||||
+ "[[1.1234567891],[1.1234567891],[1.1234567891]]\t"
|
||||
+ "[[[0.11111,0.11111]],[[0.22222,0.22222]],[[0.33333,0.33333]]]\t"
|
||||
"['2000-05-12 12:12:12.012345','2000-05-12 12:12:12.012345']\t"
|
||||
"[[1.12345],[1.12345],[1.12345]]\t"
|
||||
"[[1.1234567891],[1.1234567891],[1.1234567891]]\t"
|
||||
"[[[0.11111,0.11111]],[[0.22222,0.22222]],[[0.33333,0.33333]]]\t"
|
||||
"[[[1,1],[1,1]],[[3,3],[3,3]],[[4,4],[5,5]]]\t"
|
||||
"[[[[['winx','winx','winx']]]]]\t"
|
||||
"[[[1,NULL],[NULL,1]],[[NULL,NULL],[NULL,NULL]],[[4,4],[5,5]]]\t"
|
||||
"[[[[NULL]]]]\t"
|
||||
"[]\n"
|
||||
"[]\t"
|
||||
"['2a0c0bfc-4fec-4e32-ae3a-7fc8eea6626a','42209d53-d641-4d73-a8b6-c038db1e75d6',NULL]\t"
|
||||
"[[NULL,'42209d53-d641-4d73-a8b6-c038db1e75d6'],['2a0c0bfc-4fec-4e32-ae3a-7fc8eea6626a',NULL],[NULL,NULL]]\n"
|
||||
)
|
||||
assert result == expected
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user