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

Method writeOutCurrentRow

src/Processors/Transforms/WindowTransform.cpp:1065–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063}
1064
1065void WindowTransform::writeOutCurrentRow()
1066{
1067 chassert(current_row < partition_end);
1068 chassert(current_row.block >= first_block_number);
1069
1070 const auto & block = blockAt(current_row);
1071 for (size_t wi = 0; wi < workspaces.size(); ++wi)
1072 {
1073 auto & ws = workspaces[wi];
1074
1075 if (ws.window_function_impl)
1076 {
1077 ws.window_function_impl->windowInsertResultInto(this, wi);
1078 }
1079 else
1080 {
1081 IColumn * result_column = block.output_columns[wi].get();
1082 const auto * a = ws.aggregate_function.get();
1083 auto * buf = ws.aggregate_function_state.data();
1084 // FIXME does it also allocate the result on the arena?
1085 // We'll have to pass it out with blocks then...
1086
1087 if (ws.is_aggregate_function_state)
1088 {
1089 /// We should use insertMergeResultInto to insert result into ColumnAggregateFunction
1090 /// correctly if result contains AggregateFunction's states
1091 a->insertMergeResultInto(buf, *result_column, arena.get());
1092 }
1093 else
1094 {
1095 a->insertResultInto(buf, *result_column, arena.get());
1096 }
1097 }
1098 }
1099}
1100
1101static void assertSameColumns(const Columns & left_all,
1102 const Columns & right_all)

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.45
getMethod · 0.45
dataMethod · 0.45
insertMergeResultIntoMethod · 0.45
insertResultIntoMethod · 0.45

Tested by

no test coverage detected