z.2 AS strike,
count(*) AS count
FROM
(
SELECT arrayPopFront(arrayMap((a, b) -> (a.1, a.2 - t[(b - 1)].2), arrayPushFront(arrayFilter(t -> (t.2 != 0), arrayMap((a, b) -> if(a != x[(b + 1)], (a, b), (0, 0)), x, arrayEnumerate(x))), (0, toUInt32(0))) AS t, arrayEnumerate(t))) AS z
FROM
(
SELECT arrayMap(a -> (intHash32(a) % 2), range(150000)) AS x
)
)
ARRAY JOIN z
GROUP BY z.2
Группировка выполняется после выполнения набора всех функций. Т.е. на выходе из подзапроса имеем массив, причем небольшой, по которому выполняется Array Join и группировка. Поясните пожалуйста в каком мести происходит копирование блоков данных, почему они не шарятся?
Еще один момент. Синтетические тест создать не получилось, но когда работаешь с реальной таблицей КХ умирает. В логе следующее... 2017.10.13 06:47:58.169694 [ 34 ] <Error> BaseDaemon: ######################################## 2017.10.13 06:47:58.169743 [ 34 ] <Error> BaseDaemon: (from thread 33) Received signal Segmentation fault (11). 2017.10.13 06:47:58.169759 [ 34 ] <Error> BaseDaemon: Address: NULL pointer. 2017.10.13 06:47:58.210957 [ 34 ] <Error> BaseDaemon: 0. clickhouse-server(DB::ColumnWithTypeAndName::cloneEmpty() const+0x6d) [0x361c68d] 2017.10.13 06:47:58.210979 [ 34 ] <Error> BaseDaemon: 1. clickhouse-server(DB::Block::cloneEmpty() const+0xac) [0x2ca886c] 2017.10.13 06:47:58.210997 [ 34 ] <Error> BaseDaemon: 2. clickhouse-server(DB::ColumnTuple::cloneEmpty() const+0x32) [0x33d3ac2] 2017.10.13 06:47:58.211013 [ 34 ] <Error> BaseDaemon: 3. clickhouse-server(DB::ColumnWithTypeAndName::cloneEmpty() const+0x2d6) [0x361c8f6] 2017.10.13 06:47:58.211032 [ 34 ] <Error> BaseDaemon: 4. clickhouse-server(DB::Aggregator::initialize(DB::Block const&)+0x2e7) [0x3859ed7] 2017.10.13 06:47:58.211077 [ 34 ] <Error> BaseDaemon: 5. clickhouse-server(DB::Aggregator::executeOnBlock(DB::Block&, DB::AggregatedDataVariants&, std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*> >&, std::vector<std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*> >, std::allocator<std::vector<DB::IColumn const*, std::allocator<DB::IColumn const*> > > >&, std::vector<unsigned long, std::allocator<unsigned long> >&, std::vector<StringRef, std::allocator<StringRef> >&, bool&)+0x67) [0x3864267] 2017.10.13 06:47:58.211099 [ 34 ] <Error> BaseDaemon: 6. clickhouse-server(DB::Aggregator::execute(std::shared_ptr<DB::IBlockInputStream> const&, DB::AggregatedDataVariants&)+0x258) [0x3865e48] 2017.10.13 06:47:58.211115 [ 34 ] <Error> BaseDaemon: 7. clickhouse-server(DB::AggregatingBlockInputStream::readImpl()+0x651) [0x37eefe1] 2017.10.13 06:47:58.211131 [ 34 ] <Error> BaseDaemon: 8. clickhouse-server(DB::IProfilingBlockInputStream::read()+0x221) [0x2cb9c91] 2017.10.13 06:47:58.211148 [ 34 ] <Error> BaseDaemon: 9. clickhouse-server(DB::ExpressionBlockInputStream::readImpl()+0x2d) [0x36903bd] 2017.10.13 06:47:58.211163 [ 34 ] <Error> BaseDaemon: 10. clickhouse-server(DB::IProfilingBlockInputStream::read()+0x221) [0x2cb9c91] 2017.10.13 06:47:58.211179 [ 34 ] <Error> BaseDaemon: 11. clickhouse-server(DB::ExpressionBlockInputStream::readImpl()+0x2d) [0x36903bd] 2017.10.13 06:47:58.211195 [ 34 ] <Error> BaseDaemon: 12. clickhouse-server(DB::IProfilingBlockInputStream::read()+0x221) [0x2cb9c91] 2017.10.13 06:47:58.211214 [ 34 ] <Error> BaseDaemon: 13. clickhouse-server(DB::AsynchronousBlockInputStream::calculate(MemoryTracker*)+0x81) [0x14ccd01] 2017.10.13 06:47:58.211231 [ 34 ] <Error> BaseDaemon: 14. clickhouse-server(ThreadPool::worker()+0x141) [0x38dd251] 2017.10.13 06:47:58.211245 [ 34 ] <Error> BaseDaemon: 15. clickhouse-server() [0x414e0df] 2017.10.13 06:47:58.211272 [ 34 ] <Error> BaseDaemon: 16. /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f0eac9306ba] версия 1.1.54292
Обсуждают сегодня