v.21.12New Features

Support for PARTITION BY in File, URL, HDFS Storage with INSERT INTO Function

Support for PARTITION BY in File, URL, HDFS storages and with INSERT INTO table function. Closes #30273. #30690 (Kseniia Sumarokova).
Added support for PARTITION BY clause in File, URL, and HDFS table storages as well as with the INSERT INTO table function in ClickHouse.

Why it matters

This feature enables users to partition data dynamically when reading from or inserting into external table storages such as File, URL, and HDFS. It simplifies data organization and improves query efficiency by allowing data to be automatically partitioned based on specified expressions, aligning external storage capabilities with native ClickHouse partitioning functionality.

How to use it

Users can specify the PARTITION BY clause in the table definition or queries involving File, URL, or HDFS storages and when using the INSERT INTO table function. For example, when creating a table over a File or URL storage, include PARTITION BY with an expression to define partition keys. Similarly, when using the INSERT INTO table function, add the PARTITION BY clause to partition inserted data accordingly.