|
3 | 3 | #include "readonly_client_test.h" |
4 | 4 | #include "connection_failed_client_test.h" |
5 | 5 | #include "utils.h" |
| 6 | +#include "roundtrip_column.h" |
6 | 7 |
|
7 | 8 | #include <gtest/gtest.h> |
8 | 9 |
|
@@ -978,35 +979,6 @@ TEST_P(ClientCase, DISABLED_ArrayArrayUInt64) { |
978 | 979 | } |
979 | 980 | } |
980 | 981 |
|
981 | | -ColumnRef RoundtripColumnValues(Client& client, ColumnRef expected) { |
982 | | - // Create a temporary table with a single column |
983 | | - // insert values from `expected` |
984 | | - // select and aggregate all values from block into `result` column |
985 | | - auto result = expected->CloneEmpty(); |
986 | | - |
987 | | - const std::string type_name = result->GetType().GetName(); |
988 | | - client.Execute("DROP TEMPORARY TABLE IF EXISTS temporary_roundtrip_table;"); |
989 | | - client.Execute("CREATE TEMPORARY TABLE IF NOT EXISTS temporary_roundtrip_table (col " + type_name + ");"); |
990 | | - { |
991 | | - Block block; |
992 | | - block.AppendColumn("col", expected); |
993 | | - block.RefreshRowCount(); |
994 | | - client.Insert("temporary_roundtrip_table", block); |
995 | | - } |
996 | | - |
997 | | - client.Select("SELECT col FROM temporary_roundtrip_table", [&result](const Block& b) { |
998 | | - if (b.GetRowCount() == 0) |
999 | | - return; |
1000 | | - |
1001 | | - ASSERT_EQ(1u, b.GetColumnCount()); |
1002 | | - result->Append(b[0]); |
1003 | | - }); |
1004 | | - |
1005 | | - EXPECT_EQ(expected->GetType(), result->GetType()); |
1006 | | - EXPECT_EQ(expected->Size(), result->Size()); |
1007 | | - return result; |
1008 | | -} |
1009 | | - |
1010 | 982 | TEST_P(ClientCase, RoundtripArrayTUint64) { |
1011 | 983 | auto array = std::make_shared<ColumnArrayT<ColumnUInt64>>(); |
1012 | 984 | array->Append({0, 1, 2}); |
|
0 commit comments