import redis
from clickhouse_driver import Client

from settings import settings

rdb = redis.Redis(**settings.REDIS_CONF)

client = Client(**settings.CK_CONFIG)

sql = f"""select distinct `#event_name` as v from {settings.GAME}.event"""
df = client.query_dataframe(sql)
data = df['v'].to_list()
rdb.sadd(f'{settings.GAME}_event_set', *data)
