```
select minMap(arrayJoin([([1], [null]), ([1], [null])]));



2020.07.31 02:24:34.961498 [ 1275726 ] {feeec1c1-ba12-427a-965c-8ef6d5da92cb} <Error> : Logical error: 'Cannot compare Nulls'.
clickhouse-server: /home/akuzm/ch4/ch/src/Common/Exception.cpp:45: DB::Exception::Exception(const std::string &, int): Assertion `false' failed.
2020.07.31 02:24:34.962240 [ 1275675 ] {} <Trace> BaseDaemon: Received signal 6
2020.07.31 02:24:34.962642 [ 1276416 ] {} <Fatal> BaseDaemon: ########################################
2020.07.31 02:24:34.963363 [ 1276416 ] {} <Fatal> BaseDaemon: (version 20.7.1.1, build id: 21B0DCC47427FD8E) (from thread 1275726) (query_id: feeec1c1-ba12-427a-965c-8ef6d5da92cb) Received signal Aborted (6)
2020.07.31 02:24:34.963536 [ 1276416 ] {} <Fatal> BaseDaemon: 
2020.07.31 02:24:34.963748 [ 1276416 ] {} <Fatal> BaseDaemon: Stack trace: 0x7fd9c837318b 0x7fd9c8352859 0x7fd9c8352729 0x7fd9c8363f36 0x7fd9cc2a03a5 0x7fd9c7a5f0c4 0x7fd9c7a5ed81 0x7fd9c7a5ecd2 0x7fd9c7a5d8cb 0x7fd9c7a5e856 0x7fd9bb108b21 0x7fd9bb109d44 0x7fd9b6f8f450 0x7fd9b6f8d7b1 0x7fd9b78d34ac 0x7fd9b78d3420 0x7fd9b78d33dd 0x7fd9b78d338d 0x7fd9b78d335d 0x7fd9b78d24ae 0x7fd9ccac3635 0x7fd9ccac35d5 0x7fd9b78d0ae5 0x7fd9b78d1309 0x7fd9b78cf830 0x7fd9b78cef16 0x7fd9b78fcb3d 0x7fd9b78fcaa2
2020.07.31 02:24:34.967043 [ 1276416 ] {} <Fatal> BaseDaemon: 4. /build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51: gsignal @ 0x4618b in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2020.07.31 02:24:34.967639 [ 1276416 ] {} <Fatal> BaseDaemon: 5. /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81: abort @ 0x25859 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2020.07.31 02:24:34.968303 [ 1276416 ] {} <Fatal> BaseDaemon: 6. /build/glibc-YYA7BZ/glibc-2.31/intl/loadmsgcat.c:509: _nl_load_domain.cold @ 0x25729 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2020.07.31 02:24:34.968686 [ 1276416 ] {} <Fatal> BaseDaemon: 7. ? @ 0x36f36 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
2020.07.31 02:24:34.971511 [ 1276416 ] {} <Fatal> BaseDaemon: 8. /home/akuzm/ch4/ch/src/Common/Exception.cpp:48: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x2a23a5 in /home/akuzm/ch4/build-clang10/src/libclickhouse_common_iod.so
2020.07.31 02:24:34.983193 [ 1276416 ] {} <Fatal> BaseDaemon: 9. /home/akuzm/ch4/ch/src/Common/FieldVisitors.h:268: DB::FieldVisitorMin::operator()(DB::Null&) const @ 0x2ef60c4 in /home/akuzm/ch4/build-clang10/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
2020.07.31 02:24:34.995345 [ 1276416 ] {} <Fatal> BaseDaemon: 10. /home/akuzm/ch4/ch/src/Core/Field.h:521: auto DB::Field::dispatch<DB::FieldVisitorMin, DB::Field&>(DB::FieldVisitorMin&&, DB::Field&) @ 0x2ef5d81 in /home/akuzm/ch4/build-clang10/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
2020.07.31 02:24:35.006705 [ 1276416 ] {} <Fatal> BaseDaemon: 11. /home/akuzm/ch4/ch/src/Common/FieldVisitors.h:43: auto DB::applyVisitor<DB::FieldVisitorMin, DB::Field&>(DB::FieldVisitorMin&&, DB::Field&) @ 0x2ef5cd2 in /home/akuzm/ch4/build-clang10/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
2020.07.31 02:24:35.018086 [ 1276416 ] {} <Fatal> BaseDaemon: 12. /home/akuzm/ch4/ch/src/AggregateFunctions/AggregateFunctionSumMap.h:168: DB::AggregateFunctionMapBase<char8_t, DB::AggregateFunctionMinMap<char8_t, true>, DB::FieldVisitorMin, true, true>::add(char*, DB::IColumn const**, unsigned long, DB::Arena*) const @ 0x2ef48cb in /home/akuzm/ch4/build-clang10/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
2020.07.31 02:24:35.029393 [ 1276416 ] {} <Fatal> BaseDaemon: 13. /home/akuzm/ch4/ch/src/AggregateFunctions/IAggregateFunction.h:209: DB::IAggregateFunctionHelper<DB::AggregateFunctionMinMap<char8_t, true> >::addBatchSinglePlace(unsigned long, char*, DB::IColumn const**, DB::Arena*) const @ 0x2ef5856 in /home/akuzm/ch4/build-clang10/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
2020.07.31 02:24:35.032067 [ 1276416 ] {} <Fatal> BaseDaemon: 14. /home/akuzm/ch4/ch/src/Interpreters/Aggregator.cpp:576: DB::Aggregator::executeWithoutKeyImpl(char*&, unsigned long, DB::Aggregator::AggregateFunctionInstruction*, DB::Arena*) @ 0xe48b21 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
2020.07.31 02:24:35.032469 [ 1276416 ] {} <Fatal> BaseDaemon: 15. /home/akuzm/ch4/ch/src/Interpreters/Aggregator.cpp:719: DB::Aggregator::executeOnBlock(std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >, unsigned long, DB::AggregatedDataVariants&, std::__1::vector<DB::IColumn const*, std::__1::allocator<DB::IColumn const*> >&, std::__1::vector<std::__1::vector<DB::IColumn const*, std::__1::allocator<DB::IColumn const*> >, std::__1::allocator<std::__1::vector<DB::IColumn const*, std::__1::allocator<DB::IColumn const*> > > >&, bool&) @ 0xe49d44 in /home/akuzm/ch4/build-clang10/src/libclickhouse_interpretersd.so
2020.07.31 02:24:35.035292 [ 1276416 ] {} <Fatal> BaseDaemon: 16. /home/akuzm/ch4/ch/src/Processors/Transforms/AggregatingTransform.cpp:524: DB::AggregatingTransform::consume(DB::Chunk) @ 0x222450 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_transformsd.so
2020.07.31 02:24:35.035766 [ 1276416 ] {} <Fatal> BaseDaemon: 17. /home/akuzm/ch4/ch/src/Processors/Transforms/AggregatingTransform.cpp:494: DB::AggregatingTransform::work() @ 0x2207b1 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_transformsd.so
2020.07.31 02:24:35.037682 [ 1276416 ] {} <Fatal> BaseDaemon: 18. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:155: DB::executeJob(DB::IProcessor*) @ 0x13d4ac in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.038176 [ 1276416 ] {} <Fatal> BaseDaemon: 19. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:172: DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1::operator()() const @ 0x13d420 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.038553 [ 1276416 ] {} <Fatal> BaseDaemon: 20. /home/akuzm/ch4/ch/contrib/libcxx/include/type_traits:3519: decltype(std::__1::forward<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1&>(fp)()) std::__1::__invoke<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1&>(DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1&) @ 0x13d3dd in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.038993 [ 1276416 ] {} <Fatal> BaseDaemon: 21. /home/akuzm/ch4/ch/contrib/libcxx/include/__functional_base:349: void std::__1::__invoke_void_return_wrapper<void>::__call<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1&>(DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1&) @ 0x13d38d in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.039332 [ 1276416 ] {} <Fatal> BaseDaemon: 22. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1540: std::__1::__function::__alloc_func<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1, std::__1::allocator<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1>, void ()>::operator()() @ 0x13d35d in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.039807 [ 1276416 ] {} <Fatal> BaseDaemon: 23. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1714: std::__1::__function::__func<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1, std::__1::allocator<DB::PipelineExecutor::addJob(DB::PipelineExecutor::ExecutionState*)::$_1>, void ()>::operator()() @ 0x13c4ae in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.041509 [ 1276416 ] {} <Fatal> BaseDaemon: 24. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:1867: std::__1::__function::__value_func<void ()>::operator()() const @ 0x1c8635 in /home/akuzm/ch4/build-clang10/programs/server/libclickhouse-server-libd.so
2020.07.31 02:24:35.043063 [ 1276416 ] {} <Fatal> BaseDaemon: 25. /home/akuzm/ch4/ch/contrib/libcxx/include/functional:2473: std::__1::function<void ()>::operator()() const @ 0x1c85d5 in /home/akuzm/ch4/build-clang10/programs/server/libclickhouse-server-libd.so
2020.07.31 02:24:35.043393 [ 1276416 ] {} <Fatal> BaseDaemon: 26. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:633: DB::PipelineExecutor::executeStepImpl(unsigned long, unsigned long, std::__1::atomic<bool>*) @ 0x13aae5 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.043644 [ 1276416 ] {} <Fatal> BaseDaemon: 27. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:546: DB::PipelineExecutor::executeSingleThread(unsigned long, unsigned long) @ 0x13b309 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.043864 [ 1276416 ] {} <Fatal> BaseDaemon: 28. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:812: DB::PipelineExecutor::executeImpl(unsigned long) @ 0x139830 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.044075 [ 1276416 ] {} <Fatal> BaseDaemon: 29. /home/akuzm/ch4/ch/src/Processors/Executors/PipelineExecutor.cpp:479: DB::PipelineExecutor::execute(unsigned long) @ 0x138f16 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.045009 [ 1276416 ] {} <Fatal> BaseDaemon: 30. /home/akuzm/ch4/ch/src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:79: DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x166b3d in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
2020.07.31 02:24:35.045271 [ 1276416 ] {} <Fatal> BaseDaemon: 31. /home/akuzm/ch4/ch/src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:101: DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const @ 0x166aa2 in /home/akuzm/ch4/build-clang10/src/libclickhouse_processors_executorsd.so
```
{
        auto val = get<DecimalField<T>>(rhs);
        if (val > x)
        {
            x = val;
            return true;
        }
        return false;
    }
    template <typename T>
    bool operator() (T & x) const
    {
        auto val = get<T>(rhs);
        if (val > x)
        {
            x = val;
            return true;
        }
        return false;
    }
};
/** Implements `Min` operation.
 *  Returns true if changed
 */
class FieldVisitorMin : public StaticVisitor<bool>
{
private:
    const Field & rhs;
public:
    explicit FieldVisitorMin(const Field & rhs_) : rhs(rhs_) {}