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

Method execute

src/Functions/array/arrayAggregation.cpp:391–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389 }
390
391 static ColumnPtr execute(const ColumnArray & array, ColumnPtr mapped)
392 {
393 const IColumn::Offsets & offsets = array.getOffsets();
394 ColumnPtr res;
395
396 if constexpr (aggregate_operation == AggregateOperation::min || aggregate_operation == AggregateOperation::max)
397 {
398 executeMinOrMax(mapped, offsets, res);
399 return res;
400 }
401 else
402 {
403 if (executeType<UInt8>(mapped, offsets, res) ||
404 executeType<UInt16>(mapped, offsets, res) ||
405 executeType<UInt32>(mapped, offsets, res) ||
406 executeType<UInt64>(mapped, offsets, res) ||
407 executeType<UInt128>(mapped, offsets, res) ||
408 executeType<UInt256>(mapped, offsets, res) ||
409 executeType<Int8>(mapped, offsets, res) ||
410 executeType<Int16>(mapped, offsets, res) ||
411 executeType<Int32>(mapped, offsets, res) ||
412 executeType<Int64>(mapped, offsets, res) ||
413 executeType<Int128>(mapped, offsets, res) ||
414 executeType<Int256>(mapped, offsets, res) ||
415 executeType<Float32>(mapped, offsets, res) ||
416 executeType<Float64>(mapped, offsets, res) ||
417 executeType<Decimal32>(mapped, offsets, res) ||
418 executeType<Decimal64>(mapped, offsets, res) ||
419 executeType<Decimal128>(mapped, offsets, res) ||
420 executeType<Decimal256>(mapped, offsets, res) ||
421 executeType<DateTime64>(mapped, offsets, res))
422 {
423 return res;
424 }
425 }
426
427 throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Unexpected column for arraySum: {}", mapped->getName());
428 }
429};
430
431struct NameArrayMin { static constexpr auto name = "arrayMin"; };

Callers

nothing calls this directly

Calls 3

ExceptionClass · 0.50
getOffsetsMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected