Introduction to Hidden Partitioning
Overview
Hidden partitioning generates partition column values by transforming existing columns without requiring the explicit addition of new columns. Conversions include date formatting, string truncation, and other data operations. Hidden partitioning enables flexible data partitioning management without modifying the original table schema.
- Flexibility: Users can transform existing columns to generate partition column values based on business requirements without modifying the table schema.
- High performance: Well-designed partition directories significantly enhance query pruning, reducing scanned data and accelerating query performance.
- Simplified management: Hidden partitioning eliminates the complexity of explicitly adding partition columns, simplifying data management and maintenance.
Hudi uses hidden partitioning to implicitly transform original table columns to generate partition column values without adding new columns. This enables flexible partition hierarchies and directories, enhancing query pruning efficiency and query performance.
Notes and Constraints
- Currently, only MRS 3.5.0-LTS and later versions support Hudi hidden partitioning.
- You can enable hidden partitioning and define its rules only during table creation in Spark or Flink. Once the table is created, hidden partitioning cannot be disabled and its rules cannot be modified.
Hudi's Hidden Partitioning
Currently, Hudi hidden partitioning supports writes only via Flink and Spark, and reads via Flink, Spark, and Hetu. Hive reads are not supported.
The following partition transforms are supported.
| Transform Name | Description | Source Type | Result Type |
|---|---|---|---|
| identity(col) | Source value, unmodified | Any | Source type |
| bucket(col, N) | Hash of value, mod N | int, long, decimal, date, time, timestamp, timestamptz, string, uuid, fixed, binary | int |
| truncate(col, w) | Value truncated to width w | int, long, decimal, string | Source type |
| year(col) | Extract a date or timestamp year, as years from 1970 | date, timestamp, timestamptz | int |
| month(col) | Extract a date or timestamp month, as months from 1970-01-01 | date, timestamp, timestamptz | int |
| day(col) | Extract a date or timestamp day, as days from 1970-01-01 | date, timestamp, timestamptz | int |
| hour(col) | Extract a timestamp hour, as hours from 1970-01-01 00:00:00 | timestamp, timestamptz | int |
| date(col, 'pattern') | Format timestamp / date column with pattern pattern | date, timestamp, timestamptz | String |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot