You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample query ALTER TABLE test.ttl_rollup_test MODIFY TTL -- after 2 days: keep only the latest best price for each site-product-combination local_date + INTERVAL 2 DAY GROUP BY site_id, product_id SET local_date = max(local_date), event_time = max(event_time), price = argMax(price, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), shop_id = argMax(shop_id, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), merchant_id = argMax(merchant_id, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), offer_key = argMax(offer_key, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar)));
Currently the above statement will throw an error com.clickhouse.client.ClickHouseException: Code: 10. DB::Exception: Not found column concat(CAST(event_time, 'varchar'), CAST(minus(100000000000, price), 'varchar')) in block. There are only columns: local_date, offer_key, shop_id, price, site_id, product_id, merchant_id, event_time: While executing TTL. (NOT_FOUND_COLUMN_IN_BLOCK) (version 23.9.6.20 (official build))
This works when just doing a select like this select argMax(price, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar)))
The text was updated successfully, but these errors were encountered:
Allow support of nested function in TTL statement
Sample query
ALTER TABLE test.ttl_rollup_test MODIFY TTL -- after 2 days: keep only the latest best price for each site-product-combination local_date + INTERVAL 2 DAY GROUP BY site_id, product_id SET local_date = max(local_date), event_time = max(event_time), price = argMax(price, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), shop_id = argMax(shop_id, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), merchant_id = argMax(merchant_id, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar))), offer_key = argMax(offer_key, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar)));
Currently the above statement will throw an error
com.clickhouse.client.ClickHouseException: Code: 10. DB::Exception: Not found column concat(CAST(event_time, 'varchar'), CAST(minus(100000000000, price), 'varchar')) in block. There are only columns: local_date, offer_key, shop_id, price, site_id, product_id, merchant_id, event_time: While executing TTL. (NOT_FOUND_COLUMN_IN_BLOCK) (version 23.9.6.20 (official build))
This works when just doing a select like this
select argMax(price, concat(cast(event_time AS varchar), cast((100_000_000_000 - price) AS varchar)))
The text was updated successfully, but these errors were encountered: