#27685
{
    if (isColumnNullable(*col) || col->canBeInsideNullable())
        return makeNullable(col);
    if (col->lowCardinality())
    {
        auto mut_col = IColumn::mutate(std::move(col));
        ColumnLowCardinality * col_lc = assert_cast<ColumnLowCardinality *>(mut_col.get());
        if (col_lc->nestedIsNullable())
        {
            return mut_col;
        }
        else if (col_lc->nestedCanBeInsideNullable())
        {
            col_lc->nestedToNullable();
            return mut_col;
        }
    }
    else if (const ColumnConst * col_const = checkAndGetColumn<ColumnConst>(*col))
    {
        const auto & nested = col_const->getDataColumnPtr();
        if (nested->isNullable() || nested->canBeInsideNullable())
        {
            return makeNullable(col);