How Do I Use LakeFormation to Maintain Tables?
Internal Table Services
When creating or editing an Iceberg table, you can configure the LakeFormation table service options (only available for dedicated instances). To enable the table service for existing instances, perform the following steps:
- Log in to theLakeFormation console.
- Select the target LakeFormation instance from the drop-down list box on the left.
- On the Overview page, check whether the internal table service is enabled.
If the internal table service has been enabled for the current instance, the button for enabling the internal table service is not displayed.
- To enable the internal table service for the current instance, click the option for enabling the internal table service in the upper right corner of the page, select the operation impact, and click OK.
After the internal table service is enabled, you can create internal tables and functions. To disable the internal table service, you need to completely clear the internal tables. The internal table service is automatically disabled when the instance is deleted.
After the internal table service is enabled, you need to configure the table service to enable compression, snapshot, and orphaned file deletion.
Compaction
Whether to combine small data files into larger, more efficient files to improve table performance.
If this option is selected, you need to set the following compression parameters:
- Compaction Strategy:
- Binpack: Combines small files into larger files, typically targeting sizes over 100 MB, while applying any pending deletes. This compression policy is the default and recommended option for most use cases.
- Sort: Organizes data of specified columns, which are sorted hierarchically during compression to improve the query performance of filter operations. This policy is recommended when query operations frequently filter specific columns. Before using this policy, you need to define the sorting order using the sort-order property in the column-store table.
- Z-Order: Optimizes data organization by combining multiple properties into a single scalar value that can be used for sorting, enabling efficient queries across multiple dimensions. This policy is recommended when you need to query data across multiple dimensions. Before using this policy, you need to use the sort-order table property in the Apache Iceberg table to define the sorting order.
- Minimum Input Files: The minimum number of data-files to be present in a partition before compaction will actually compact files. The value ranges from 3 to 100, with 5 as the default value.
- Compacted File Size: The target file size after compaction, in MB. The value ranges from 128 to 2048, with 512 as the default value.
Snapshot Retention
Whether to optimize table storage by removing old snapshots from metadata overhead and expiring files that are no longer needed.
If this option is selected, you need to set the following snapshot retention parameters:
- Snapshot Retention Period: How long Iceberg retains historical snapshots before deleting them, in hours. The value ranges from 24 to 1440, with 72 as the default value.
- Minimum Snapshot to Retain: The minimum number of snapshots to retain. The value ranges from 1 to 100, with 10 as the default value.
- Delete Associated Files: Whether to delete files associated with the expired snapshots.
By default, the snapshot retention strategy deletes both the metadata and data files of expired snapshots. To retain the metadata and delete only the data files, clear the Delete Associated Files option.
- Execution Interval: The interval at which the task runs, in hours. The value ranges from 1 to 168, with 24 as the default value.
Orphan File Deletion
Whether to periodically delete orphaned files.
If this option is selected, you need to set the following parameters for deleting orphaned files:
- Orphan File Retention Period: The retention period for orphan files, in hours. The value ranges from 24 to 1440, with 72 as the default value.
- Execution Interval: The interval at which the task runs, in hours. The value ranges from 1 to 168, with 24 as the default value.
- The orphan file deletion strategy will delete files identified as orphans, which are files that are not referenced by Iceberg metadata.
- To ensure no files are mistakenly considered as orphaned files and deleted, make sure that the provided table location and any sub-paths do not overlap with or contain any other table or non-table data. The deletion operation cannot be undone.
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