code: def rename(self, new_name, database=None):
          
          m = ddl.fully_qualified_re.match(new_name)
          if not m and database is None:
              database = self._database
  
          statement = ddl.RenameTable(
              self._qualified_name, new_name, new_database=database
          )
  
          self._client._execute(statement)
  
          op = self.op().change_name(statement.new_qualified_name)
          return type(self)(op)
docs: Rename table inside MapD. References to the old table are no longer
          valid.
  
          Parameters
          ----------
          new_name : string
          database : string
  
          Returns
          -------
          renamed : MapDTable