Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Hudi/ Hudi SQL Syntax Reference/ Hidden Partitioning/ Creating a Hudi Table in Flink and Enabling Hidden Partitioning
Updated on 2026-06-27 GMT+08:00

Creating a Hudi Table in Flink and Enabling Hidden Partitioning

Create a Hudi table in Flink and enable hidden partitioning. For details about the table creation statement, see Creating a FlinkServer Job to Interconnect with a Hudi Table.

Add the following hidden partitioning parameters in the Hudi table with clause of Flink SQL:

hoodie.hidden.partitioning.max.rules = [hidden_partition_max_rules_num]
'hoodie.hidden.partitioning.enabled' =  [hidden_partition_enable]
'hoodie.hidden.partitioning.rule' =  [hidden_partition_rules]
Table 1 Parameter description

Parameter

Description

Mandatory

hoodie.hidden.partitioning.max.rules

Maximum number of hidden partitioning rules. The value is a string. This parameter limits the number of partition path generation rules, directly impacting partitioning flexibility and performance.

No. The default value is 5. Performance degrades as the number of partitioning rules increases. If more than five rules are defined, you should adjust this parameter.

hidden_partition_rules

Hidden partitioning rules. The value is a string. These rules generate partition column values by transforming existing table columns without adding new ones.

Yes

hidden_partition_enable

Whether to enable hidden partitioning. The value is a Boolean.

  • true: enables hidden partitioning.
  • false: disables hidden partitioning.

Yes

Example

create table hudi_source(
uuid varchar(20),
name varchar(10),
age int,
ts timestamp(3),
ts6 timestamp(6),
p varchar(20)
) with (
'connector' = 'hudi',
'path' = 'hdfs://hacluster/tmp/hudi/flink_stream_mor3',
'table.type' = 'MERGE_ON_READ',
'hoodie.datasource.write.recordkey.field' = 'uuid',
'write.precombine.field' = 'uuid',
'hoodie.datasource.write.hive_style_partitioning' = 'true',
'hoodie.hidden.partitioning.enabled' = 'true',
'hoodie.hidden.partitioning.rule' = 'truncate(partition, 3), date(ts, yyyy), identity(col1)'
);