```
select tupleElement(CAST(tuple(1,2),'Tuple(x UInt64, y UInt64)'), 'x') 
-- ok

select tupleElement(CAST(tuple(1,2),'Tuple(x UInt64, y UInt64)'), 'z')

-- fails
-- Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Tuple doesn't have element with name 'z': While processing tupleElement(CAST((1, 2), 'Tuple(x UInt64, y UInt64)'), 'z'). (NOT_FOUND_COLUMN_IN_BLOCK)
```
Proposal - add the 3rd parameter to the tupleElement function and return it if tuple doesn't have a member.

Why? Tuple comes from object('JSON'), sometimes some fields are missing in some jsons.
: elems(elems_), names(names_), have_explicit_names(true)
{
    size_t size = elems.size();
    if (names.size() != size)
        throw Exception("Wrong number of names passed to constructor of DataTypeTuple", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
    if (auto exception = checkTupleNames(names))
        throw std::move(*exception);
}
std::string DataTypeTuple::doGetName() const
{
    size_t size = elems.size();
    WriteBufferFromOwnString s;
    s << "Tuple(";
    for (size_t i = 0; i < size; ++i)
    {
        if (i != 0)
            s << ", ";
        if (have_explicit_names)
            s << backQuoteIfNeed(names[i]) << ' ';
        s << elems[i]->getName();
    }
    s << ")";
    return s.str();
}
static inline IColumn & extractElementColumn(IColumn & column, size_t idx)
{
    return assert_cast<ColumnTuple &>(column).getColumn(idx);
}
template <typename F>
static void addElementSafe(const DataTypes & elems, IColumn & column, F && impl)