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

Function executeConst

src/Functions/array/emptyArrayToSingle.cpp:27–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 namespace FunctionEmptyArrayToSingleImpl
26 {
27 ColumnPtr executeConst(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count)
28 {
29 if (const ColumnConst * const_array = checkAndGetColumnConst<ColumnArray>(arguments[0].column.get()))
30 {
31 if (const_array->getValue<Array>().empty())
32 {
33 auto nested_type = typeid_cast<const DataTypeArray &>(*arguments[0].type).getNestedType();
34
35 return result_type->createColumnConst(
36 input_rows_count,
37 Array{nested_type->getDefault()});
38 }
39 return arguments[0].column;
40 }
41 return nullptr;
42 }
43
44 template <typename T, bool nullable>
45 bool executeNumber(

Callers 3

executeImplMethod · 0.85
executeOnNonNullableMethod · 0.85
executeImplMethod · 0.85

Calls 5

getNestedTypeMethod · 0.80
getMethod · 0.45
emptyMethod · 0.45
createColumnConstMethod · 0.45
getDefaultMethod · 0.45

Tested by

no test coverage detected