'Test to ensure that altered UDT\'s are properly surfaced without needing to restart the underlying session.
@since 3.0.0
@jira_ticket PYTHON-226
@expected_result UDT\'s will reflect added columns without a session restart.
@test_category data_types, udt'

@lessthancass30
def test_alter_udt(self):

    self.session.set_keyspace(self.keyspace_name)
    self.session.execute('CREATE    TYPE    typetoalter    (a    int)')
    typetoalter = namedtuple('typetoalter', 'a')
    self.session.execute('CREATE    TABLE    {0}    (pk    int    primary    key,    typetoalter    frozen<typetoalter>)'.format(self.function_table_name))
    insert_statement = self.session.prepare('INSERT    INTO    {0}    (pk,    typetoalter)    VALUES    (?,    ?)'.format(self.function_table_name))
    self.session.execute(insert_statement, [1, typetoalter(1)])
    results = self.session.execute('SELECT    *    from    {0}'.format(self.function_table_name))
    for result in results:
        self.assertTrue(hasattr(result.typetoalter, 'a'))
        self.assertFalse(hasattr(result.typetoalter, 'b'))
    self.session.execute('ALTER    TYPE    typetoalter    add    b    int')
    typetoalter = namedtuple('typetoalter', ('a', 'b'))
    self.session.execute(insert_statement, [2, typetoalter(2, 2)])
    results = self.session.execute('SELECT    *    from    {0}'.format(self.function_table_name))
    for result in results:
        self.assertTrue(hasattr(result.typetoalter, 'a'))
        self.assertTrue(hasattr(result.typetoalter, 'b'))
