#NEWLINE# def rename( self , new_name , database = None ) : #NEWLINE# #INDENT# '\n        Rename table inside Impala. References to the old table are no longer\n        valid.\n\n        Parameters\n        ----------\n        new_name : string\n        database : string\n\n        Returns\n        -------\n        renamed : ImpalaTable\n        ' #NEWLINE# m = ddl . fully_qualified_re . match ( new_name ) #NEWLINE# if ( ( not m ) and ( database is None ) ) : #NEWLINE# #INDENT# database = new_name . _database #NEWLINE# #UNINDENT# statement = ddl . RenameTable ( self . _qualified_name , new_name , new_database = database ) #NEWLINE# self . _client . _execute ( statement ) #NEWLINE# op = self . op ( ) . change_name ( statement . new_qualified_name ) #NEWLINE# return ImpalaTable ( op )