```
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.
{
    if (!arguments || arguments->children.empty())
        throw Exception("Tuple cannot be empty", ErrorCodes::EMPTY_DATA_PASSED);
    DataTypes nested_types;
    nested_types.reserve(arguments->children.size());
    Strings names;
    names.reserve(arguments->children.size());
    for (const ASTPtr & child : arguments->children)
    {
        if (const auto * name_and_type_pair = child->as<ASTNameTypePair>())
        {
            nested_types.emplace_back(DataTypeFactory::instance().get(name_and_type_pair->type));
            names.emplace_back(name_and_type_pair->name);
        }
        else
            nested_types.emplace_back(DataTypeFactory::instance().get(child));
    }
    if (names.empty())
        return std::make_shared<DataTypeTuple>(nested_types);
    else if (names.size() != nested_types.size())
        throw Exception("Names are specified not for all elements of Tuple type", ErrorCodes::BAD_ARGUMENTS);
    else
        return std::make_shared<DataTypeTuple>(nested_types, names);
}
void registerDataTypeTuple(DataTypeFactory & factory)
{
    factory.registerDataType("Tuple", create);
}
}