1#include "GatherUtils.h"
2#include "Selectors.h"
3#include "Algorithms.h"
4
5namespace DB::GatherUtils
6{
7
8struct ArrayPush : public ArrayAndValueSourceSelectorBySink<ArrayPush>
9{
10 template <typename ArraySource, typename ValueSource, typename Sink>
11 static void selectArrayAndValueSourceBySink(
12 ArraySource && array_source, ValueSource && value_source, Sink && sink, bool push_front)
13 {
14 if (push_front)
15 concat(value_source, array_source, sink);
16 else
17 concat(array_source, value_source, sink);
18 }
19};
20
21
22void push(IArraySource & array_source, IValueSource & value_source, IArraySink & sink, bool push_front)
23{
24 ArrayPush::select(sink, array_source, value_source, push_front);
25}
26}
27