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'. 
```
if (cond_is_true)
            return castColumn(column1, result_type);
        else if (cond_is_false || cond_is_null)
            return castColumn(column2, result_type);
        if (const auto * nullable = checkAndGetColumn<ColumnNullable>(*not_const_condition))
        {
            ColumnPtr new_cond_column = nullable->getNestedColumnPtr();
            size_t column_size = arg_cond.column->size();
            if (checkAndGetColumn<ColumnUInt8>(*new_cond_column))
            {
                auto nested_column_copy = new_cond_column->cloneResized(new_cond_column->size());
                typeid_cast<ColumnUInt8 *>(nested_column_copy.get())->applyZeroMap(nullable->getNullMapData());
                new_cond_column = std::move(nested_column_copy);
                if (cond_is_const)
                    new_cond_column = ColumnConst::create(new_cond_column, column_size);
            }
            else
                throw Exception("Illegal column " + arg_cond.column->getName() + " of " + getName() + " condition",
                                ErrorCodes::ILLEGAL_COLUMN);
            ColumnsWithTypeAndName temporary_columns
            {
                { new_cond_column, removeNullable(arg_cond.type), arg_cond.name },
                column1,
                column2,
            };
            return executeImpl(temporary_columns, result_type, new_cond_column->size());
        }
        return nullptr;
    }
    static ColumnPtr materializeColumnIfConst(const ColumnPtr & column)