'Install the common test tables (only once)'

@classmethod
def init_beeswax_db(cls):

    global _INITIALIZED
    if _INITIALIZED:
        return
    make_query(cls.client, ('CREATE    DATABASE    IF    NOT    EXISTS    %(db)s' % {'db': cls.db_name}), wait=True)
    make_query(cls.client, ('CREATE    DATABASE    IF    NOT    EXISTS    %(db)s_other' % {'db': cls.db_name}), wait=True)
    if cls.load_data:
        data_file = (cls.cluster.fs_prefix + u'/beeswax/sample_data_\xe9chantillon_%d.tsv')
        CREATE_PARTITIONED_TABLE = ("\n                                CREATE    TABLE    `%(db)s`.`test_partitions`    (foo    INT,    bar    STRING)\n                                PARTITIONED    BY    (baz    STRING,    boom    INT)\n                                ROW    FORMAT    DELIMITED\n                                        FIELDS    TERMINATED    BY    ' DCTB '\n                                        LINES    TERMINATED    BY    '\n'\n                        " % {'db': cls.db_name})
        make_query(cls.client, CREATE_PARTITIONED_TABLE, wait=True)
        cls._make_data_file((data_file % 1))
        LOAD_DATA = ("\n                                LOAD    DATA    INPATH    '%(data_file)s'\n                                OVERWRITE    INTO    TABLE    `%(db)s`.`test_partitions`\n                                PARTITION    (baz='baz_one',    boom=12345)\n                        " % {'db': cls.db_name, 'data_file': (data_file % 1)})
        make_query(cls.client, LOAD_DATA, wait=True, local=False)
        ADD_PARTITION = ("\n                                ALTER    TABLE    `%(db)s`.`test_partitions`    ADD    PARTITION(baz='baz_foo',    boom=67890)    LOCATION    '%(fs_prefix)s/baz_foo/boom_bar'\n                        " % {'db': cls.db_name, 'fs_prefix': cls.cluster.fs_prefix})
        make_query(cls.client, ADD_PARTITION, wait=True, local=False)
        CREATE_TABLE = '\n                                CREATE    TABLE    `%(db)s`.`%(name)s`    (foo    INT,    bar    STRING)\n                                COMMENT    "%(comment)s"\n                                ROW    FORMAT    DELIMITED\n                                        FIELDS    TERMINATED    BY    \' DCTB \'\n                                        LINES    TERMINATED    BY    \'\n\'\n                        '
        table_info = {'db': cls.db_name, 'name': 'test', 'comment': 'Test    table'}
        cls._make_data_file((data_file % 2))
        cls._make_table(table_info['name'], (CREATE_TABLE % table_info), (data_file % 2))
        if is_live_cluster():
            LOG.warn('HUE-2884:    We    cannot    create    Hive    UTF8    tables    when    live    cluster    testing    at    the    moment')
        else:
            table_info = {'db': cls.db_name, 'name': 'test_utf8', 'comment': cls.get_i18n_table_comment()}
            cls._make_i18n_data_file((data_file % 3), 'utf-8')
            cls._make_table(table_info['name'], (CREATE_TABLE % table_info), (data_file % 3))
            table_info = {'db': cls.db_name, 'name': 'test_latin1', 'comment': cls.get_i18n_table_comment()}
            cls._make_i18n_data_file((data_file % 4), 'latin1')
            cls._make_table(table_info['name'], (CREATE_TABLE % table_info), (data_file % 4))
        make_query(cls.client, ('CREATE    VIEW    `%(db)s`.`myview`    (foo,    bar)    as    SELECT    *    FROM    `%(db)s`.`test`' % {'db': cls.db_name}), wait=True)
    _INITIALIZED = True
