-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache Iceberg column types in Glue for faster access
Make `information_schema.columns` queries faster by storing the necessary information directly in Glue so that loading Iceberg metadata from storage is not need. - Table comment is stored as `comment` Glue table parameter. - Column Trino type is stored as Glue column type (for some cases) or as `trino_type` column table parameter. This is because, following Iceberg own's `org.apache.iceberg.aws.glue.IcebergToGlueConverter.toTypeString` the column type written to Glue is not accurate, so this piece of information may be lossy. In such cases the column parameter is used to store the Trino type. - For more compatibility we could store Iceberg type string, but Iceberg lacks API to reconstruct Type from string (except for primitive types). This is not surprising, as it needs IDs for all fields. Something that is not needed to answer metadata queries. - Column NOT NULL constraint is stored as `trino_not_null=true` column table parameter (omitted for nullable columns). Before the above cached information is used, the following conditions are checked - the `trino_table_metadata_info_valid_for` table property must be set to current metadata location. This ensures that the cached information is invalided whenever metadata location changes. - at least one column must have `trino_type` property set. This ensures the cached information is not used when column parameters were lost in transit or otherwise erased. `iceberg.glue.cache-table-metadata` serves as a kill-switch for the new functionality (both write & read parts).
- Loading branch information
Showing
19 changed files
with
447 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.