v.21.12New Features
Support for PARTITION BY in File, URL, HDFS Storage with INSERT INTO Function
Support forPARTITION BYin File, URL, HDFS storages and withINSERT INTOtable function. Closes #30273. #30690 (Kseniia Sumarokova).
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 thePARTITION 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.