Initializing the Partitions of Inventory Tables
Function
Calculate the last modification time of each historical partition and write the time to the .hoodie_partition_metadata file in each partition in the format of lastUpdateTime=Last modification time. TTL determines whether a partition is aged based on the result of Current system time – Last modification time of the partition.
Syntax
call ttl_update_partitions(table => "[table]", path => "[path]", dryRun => [dryRun])
- If dryRun is true, the last modification time of each partition is printed, but is not written to the .hoodie_partition_metadata file.
- When dryRun is false, the last modification time of each partition is printed and written to the .hoodie_partition_metadata file.
Description
Parameter |
Description |
Mandatory |
---|---|---|
table |
Table name. Database name.Table name is also supported. The value is a string. |
No. Specify either table or path. |
path |
Absolute path of the table. The value is a string. |
No. Specify either table or path. |
dryRun |
The value is of the Boolean type. |
The value can be false or true. The default value is false. |
Examples
Initialize TTL by specifying a table name.
call ttl_update_partitions(table => "hudi_table", dryRun => true)
Initialize TTL by specifying a path.
call ttl_update_partitions(path => "hdfs://hacluster/user/hive/warehouse/hudi_table/", dryRun => true)
Feedback
Was this page helpful?
Provide feedbackThank 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