'Create table in the Hive Metastore.'

def create(self, django_user):

    LOG.info(('Creating    table    "%s"' % (self.name,)))
    db = dbms.get(django_user, self.query_server)
    try:
        if (self.app_name == 'impala'):
            db.invalidate(database=self.db_name, flush_all=False)
        db.get_table(self.db_name, self.name)
        msg = (_('Table    "%(table)s"    already    exists.') % {'table': self.name})
        LOG.error(msg)
        return False
    except Exception:
        query = hql_query(self.hql)
        try:
            db.use(self.db_name)
            results = db.execute_and_wait(query)
            if (not results):
                msg = (_('Error    creating    table    %(table)s:    Operation    timeout.') % {'table': self.name})
                LOG.error(msg)
                raise InstallException(msg)
            return True
        except Exception as ex:
            msg = (_('Error    creating    table    %(table)s:    %(error)s.') % {'table': self.name, 'error': ex})
            LOG.error(msg)
            raise InstallException(msg)
