Reproduction steps:
```
CREATE TABLE table_left                                                                                                                                                                                              
(                                                                                                                                                                                                                    
    `date` Date,                                                                                                                                                                                                     
    `uid` String                                                                                                                                                                                                     
)                                                                                                                                                                                                                    
ENGINE = MergeTree()                                                                                                                                                                                                 
ORDER BY (date, uid)          
                                                                                                                                                                                       
CREATE TABLE table_right                                                                                                                                                                                             
(                                                                                                                                                                                                                    
    `date` Date,                                                                                                                                                                                                     
    `value` Decimal(18, 10)                                                                                                                                                                                          
)                                                                                                                                                                                                                    
ENGINE = MergeTree()                                                                                                                                                                                                 
ORDER BY date

INSERT INTO table_left values(toDate('2019-10-01'), 'hello');
INSERT INTO table_right values (toDate('2019-10-01'), 1), (toDate('2029-10-01'), 2);

SET join_use_nulls = 1;

SELECT ifNull(subquery_right.alias_value, 0)
FROM table_left
FULL OUTER JOIN 
(
    SELECT
        date,
        value AS alias_value
    FROM table_right
) AS subquery_right
ON table_left.date = subquery_right.date

Received exception from server (version 21.3.1):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Incompatible types of arguments corresponding to two conditional branches: while executing 'FUNCTION ifNull(alias_value :: 0, 0 :: 1) -> ifNull(alias_value, 0) Decimal(18, 10) : 2'. 
```
const ColumnUInt8 * cond_col,
            const ColumnsWithTypeAndName & arguments,
            const ColumnConst * col_left) const
    {
        using ResultType = typename NumberTraits::ResultOfIf<T0, T1>::Type;
        const IColumn * col_right_untyped = arguments[2].column.get();
        UInt32 scale = decimalScale<T0, T1>(arguments);
        if (const auto * col_right_vec = checkAndGetColumn<ColVecT1>(col_right_untyped))
        {
            return NumIfImpl<T0, T1, ResultType>::constantVector(
                cond_col->getData(), col_left->template getValue<T0>(), col_right_vec->getData(), scale);
        }
        else if (const auto * col_right_const = checkAndGetColumnConst<ColVecT1>(col_right_untyped))
        {
            return NumIfImpl<T0, T1, ResultType>::constantConstant(
                cond_col->getData(), col_left->template getValue<T0>(), col_right_const->template getValue<T1>(), scale);
        }
        return nullptr;
    }
    template <typename T0, typename T1, typename ColVecT0, typename ColVecT1>
    ColumnPtr executeRightTypeArray(