MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / extractValuesDispatch

Function extractValuesDispatch

src/DataTypes/DataTypeMapHelpers.cpp:375–444  ·  view source on GitHub ↗

Dispatches to the appropriate specialized value extractor based on the value column type. For Nullable columns, unwraps to the nested column and passes null map pointers to the same extractors used for non-nullable columns.

Source from the content-addressed store, hash-verified

373/// For Nullable columns, unwraps to the nested column and passes null map pointers
374/// to the same extractors used for non-nullable columns.
375void extractValuesDispatch(
376 const IColumn & values_column,
377 IColumn & result,
378 const PaddedPODArray<size_t> & matched_positions)
379{
380 /// Unwrap Nullable if present to get the underlying data column and null maps.
381 const IColumn * data_column = &values_column;
382 IColumn * result_data_column = &result;
383 const NullMap * src_null_map = nullptr;
384 NullMap * dst_null_map = nullptr;
385
386 if (const auto * nullable_values = typeid_cast<const ColumnNullable *>(&values_column))
387 {
388 auto & nullable_result = assert_cast<ColumnNullable &>(result);
389 data_column = &nullable_values->getNestedColumn();
390 result_data_column = &nullable_result.getNestedColumn();
391 src_null_map = &nullable_values->getNullMapData();
392 dst_null_map = &nullable_result.getNullMapData();
393 }
394
395 TypeIndex type_id = data_column->getDataType();
396
397 switch (type_id)
398 {
399#define DISPATCH_VECTOR(T) \
400 case TypeIndex::T: \
401 { \
402 using ColType = ColumnVector<T>; \
403 extractValuesVector<T>( \
404 assert_cast<const ColType &>(*data_column), \
405 assert_cast<ColType &>(*result_data_column), \
406 matched_positions, src_null_map, dst_null_map); \
407 return; \
408 }
409
410 DISPATCH_VECTOR(UInt8)
411 DISPATCH_VECTOR(UInt16)
412 DISPATCH_VECTOR(UInt32)
413 DISPATCH_VECTOR(UInt64)
414 DISPATCH_VECTOR(Int8)
415 DISPATCH_VECTOR(Int16)
416 DISPATCH_VECTOR(Int32)
417 DISPATCH_VECTOR(Int64)
418 DISPATCH_VECTOR(Float32)
419 DISPATCH_VECTOR(Float64)
420#undef DISPATCH_VECTOR
421
422 case TypeIndex::String:
423 {
424 extractValuesString(
425 assert_cast<const ColumnString &>(*data_column),
426 assert_cast<ColumnString &>(*result_data_column),
427 matched_positions, src_null_map, dst_null_map);
428 return;
429 }
430 case TypeIndex::FixedString:
431 {
432 extractValuesFixedString(

Callers 1

extractKeyValueFromMapFunction · 0.85

Calls 4

extractValuesStringFunction · 0.85
extractValuesFixedStringFunction · 0.85
extractValuesGenericFunction · 0.85
getDataTypeMethod · 0.45

Tested by

no test coverage detected