@@ -154,6 +154,7 @@ TEST_P(RoundtripCase, Ring) {
154
154
std::vector<ColumnPoint::ValueType> ring{{0.1 , 0.2 }, {0.3 , 0.4 }};
155
155
col->Append (ring);
156
156
}
157
+
157
158
auto result_typed = RoundtripColumnValues (*client_, col)->AsStrict <ColumnRing>();
158
159
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
159
160
}
@@ -174,6 +175,7 @@ TEST_P(RoundtripCase, Polygon) {
174
175
{{{0.1 , 0.2 }, {0.3 , 0.4 }}, {{0.5 , 0.6 }, {0.7 , 0.8 }}};
175
176
col->Append (polygon);
176
177
}
178
+
177
179
auto result_typed = RoundtripColumnValues (*client_, col)->AsStrict <ColumnPolygon>();
178
180
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
179
181
}
@@ -196,18 +198,21 @@ TEST_P(RoundtripCase, MultiPolygon) {
196
198
{{{1.1 , 1.2 }, {1.3 , 1.4 }}, {{1.5 , 1.6 }, {1.7 , 1.8 }}}};
197
199
col->Append (multi_polygon);
198
200
}
201
+
199
202
auto result_typed = RoundtripColumnValues (*client_, col)->AsStrict <ColumnMultiPolygon>();
200
203
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
201
204
}
202
205
203
206
TEST_P (RoundtripCase, LowCardinalityTString) {
204
207
using TestColumn = ColumnLowCardinalityT<ColumnString>;
205
208
auto col = std::make_shared<TestColumn>();
209
+
206
210
col->Append (" abc" );
207
211
col->Append (" def" );
208
212
col->Append (" abc" );
209
213
col->Append (" abc" );
210
- auto result_typed = WrapColumn<TestColumn>(RoundtripColumnValues (*client_, col));
214
+
215
+ auto result_typed = RoundtripColumnValues (*client_, col)->As <TestColumn>();
211
216
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
212
217
}
213
218
@@ -224,25 +229,29 @@ TEST_P(RoundtripCase, LowCardinalityTNullableString) {
224
229
col->Append (std::nullopt);
225
230
col->Append (" foobar" );
226
231
227
- auto result_typed = WrapColumn<TestColumn>( RoundtripColumnValues (*client_, col));
232
+ auto result_typed = RoundtripColumnValues (*client_, col)-> As <TestColumn>( );
228
233
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
229
234
}
230
235
231
236
TEST_P (RoundtripCase, ArrayTNullableString) {
232
237
using TestColumn = ColumnArrayT<ColumnNullableT<ColumnString>>;
233
238
auto col = std::make_shared<TestColumn>();
239
+
234
240
col->Append ({std::nullopt, std::nullopt, std::nullopt});
235
241
col->Append (std::vector<std::optional<std::string>>{" abc" , std::nullopt});
236
- auto result_typed = WrapColumn<TestColumn>(RoundtripColumnValues (*client_, col));
242
+
243
+ auto result_typed = RoundtripColumnValues (*client_, col)->As <TestColumn>();
237
244
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
238
245
}
239
246
240
247
TEST_P (RoundtripCase, TupleTNullableString) {
241
248
using TestColumn = ColumnTupleT<ColumnNullableT<ColumnString>>;
242
249
auto col = std::make_shared<TestColumn>(std::make_tuple (std::make_shared<ColumnNullableT<ColumnString>>()));
250
+
243
251
col->Append (std::make_tuple (std::nullopt));
244
252
col->Append (std::make_tuple (" abc" ));
245
- auto result_typed = WrapColumn<TestColumn>(RoundtripColumnValues (*client_, col));
253
+
254
+ auto result_typed = RoundtripColumnValues (*client_, col)->As <TestColumn>();
246
255
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
247
256
}
248
257
@@ -253,48 +262,54 @@ TEST_P(RoundtripCase, Map_TString_TNullableString) {
253
262
auto col = std::make_shared<TestColumn>(std::make_shared<Key>(), std::make_shared<Value>());
254
263
{
255
264
std::map<std::string, std::optional<std::string>> value;
256
- value[" 1" ]= " one" ;
257
- value[" 2" ]= std::nullopt;
265
+ value[" 1" ] = " one" ;
266
+ value[" 2" ] = std::nullopt;
258
267
col->Append (value);
259
268
}
260
269
{
261
270
std::map<std::string, std::optional<std::string>> value;
262
- value[" 4" ]= " one" ;
263
- value[" 2" ]= std::nullopt;
271
+ value[" 4" ] = " one" ;
272
+ value[" 2" ] = std::nullopt;
264
273
col->Append (value);
265
274
}
266
- auto result_typed = WrapColumn<TestColumn>( RoundtripColumnValues (*client_, col));
275
+ auto result_typed = RoundtripColumnValues (*client_, col)-> As <TestColumn>( );
267
276
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
268
277
}
269
278
270
279
TEST_P (RoundtripCase, Map_LowCardinalityTString_LowCardinalityTNullableString) {
271
280
using Key = ColumnLowCardinalityT<ColumnString>;
272
281
using Value = ColumnLowCardinalityT<ColumnNullableT<ColumnString>>;
273
282
using TestColumn = ColumnMapT<Key, Value>;
283
+
274
284
auto col = std::make_shared<TestColumn>(std::make_shared<Key>(), std::make_shared<Value>());
275
285
{
276
286
std::map<std::string, std::optional<std::string>> value;
277
- value[" 1" ]= " one" ;
278
- value[" 2" ]= std::nullopt;
287
+
288
+ value[" 1" ] = " one" ;
289
+ value[" 2" ] = std::nullopt;
290
+
279
291
col->Append (value);
280
292
}
281
293
{
282
294
std::map<std::string, std::optional<std::string>> value;
283
- value[" 4" ]= " one" ;
284
- value[" 2" ]= std::nullopt;
295
+
296
+ value[" 4" ] = " one" ;
297
+ value[" 2" ] = std::nullopt;
298
+
285
299
col->Append (value);
286
300
}
287
- auto result_typed = WrapColumn<TestColumn>( RoundtripColumnValues (*client_, col));
301
+ auto result_typed = RoundtripColumnValues (*client_, col)-> As <TestColumn>( );
288
302
EXPECT_TRUE (CompareRecursive (*col, *result_typed));
289
303
}
290
304
291
305
TEST_P (RoundtripCase, RoundtripArrayLowCardinalityTString) {
292
306
using TestColumn = ColumnArrayT<ColumnLowCardinalityT<ColumnString>>;
293
307
auto array = std::make_shared<TestColumn>();
308
+
294
309
array->Append (std::vector<std::string>{});
295
310
array->Append (std::vector<std::string>{});
296
311
297
- auto result_typed = WrapColumn<TestColumn>( RoundtripColumnValues (*client_, array));
312
+ auto result_typed = RoundtripColumnValues (*client_, array)-> As <TestColumn>( );
298
313
EXPECT_TRUE (CompareRecursive (*array, *result_typed));
299
314
}
300
315
@@ -311,6 +326,7 @@ INSTANTIATE_TEST_SUITE_P(
311
326
ClientOptions (LocalHostEndpoint)
312
327
.SetPingBeforeQuery(true )
313
328
.SetBakcwardCompatibilityFeatureLowCardinalityAsWrappedColumn(false ),
329
+
314
330
ClientOptions(LocalHostEndpoint)
315
331
.SetPingBeforeQuery(false )
316
332
.SetCompressionMethod(CompressionMethod::LZ4)
0 commit comments