Using clickhouse to transform tick data into OHLC