From 09c27938f31f3a2c3c82b4dc3ae97cbe6c80d586 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Wed, 23 Oct 2024 18:11:27 +0900 Subject: [PATCH] Replace `_` with `-` in config property names --- .../main/java/io/trino/memory/MemoryManagerConfig.java | 3 ++- .../java/io/trino/memory/TestMemoryManagerConfig.java | 2 +- docs/src/main/sphinx/connector/iceberg.md | 8 ++++---- .../main/java/io/trino/plugin/iceberg/IcebergConfig.java | 6 ++++-- .../io/trino/plugin/iceberg/BaseIcebergConnectorTest.java | 4 ++-- .../java/io/trino/plugin/iceberg/TestIcebergConfig.java | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java b/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java index 8949083d9da34..19b2e84869e79 100644 --- a/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java @@ -166,7 +166,8 @@ public DataSize getFaultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercomm return faultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercommit; } - @Config("fault-tolerant-execution-eager-speculative-tasks-node_memory-overcommit") + @Config("fault-tolerant-execution-eager-speculative-tasks-node-memory-overcommit") + @LegacyConfig("fault-tolerant-execution-eager-speculative-tasks-node_memory-overcommit") public MemoryManagerConfig setFaultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercommit(DataSize faultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercommit) { this.faultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercommit = faultTolerantExecutionEagerSpeculativeTasksNodeMemoryOvercommit; diff --git a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java index 40bfa0102d88c..a2d9b3f800181 100644 --- a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java @@ -58,7 +58,7 @@ public void testExplicitPropertyMappings() .put("fault-tolerant-execution-task-memory-estimation-quantile", "0.7") .put("fault-tolerant-execution-task-runtime-memory-estimation-overhead", "300MB") .put("fault-tolerant-execution-memory-requirement-increase-on-worker-crash-enabled", "false") - .put("fault-tolerant-execution-eager-speculative-tasks-node_memory-overcommit", "21GB") + .put("fault-tolerant-execution-eager-speculative-tasks-node-memory-overcommit", "21GB") .put("query.low-memory-killer.policy", "none") .put("task.low-memory-killer.policy", "none") .buildOrThrow(); diff --git a/docs/src/main/sphinx/connector/iceberg.md b/docs/src/main/sphinx/connector/iceberg.md index 3c0c13bdbbafc..35aecf9781152 100644 --- a/docs/src/main/sphinx/connector/iceberg.md +++ b/docs/src/main/sphinx/connector/iceberg.md @@ -197,12 +197,12 @@ implementation is used: - Set to `false` to disable in-memory caching of metadata files on the coordinator. This cache is not used when `fs.cache.enabled` is set to true. - `true` -* - `iceberg.expire_snapshots.min-retention` +* - `iceberg.expire-snapshots.min-retention` - Minimal retention period for the [`expire_snapshot` command](iceberg-expire-snapshots). Equivalent session property is `expire_snapshots_min_retention`. - `7d` -* - `iceberg.remove_orphan_files.min-retention` +* - `iceberg.remove-orphan-files.min-retention` - Minimal retention period for the [`remove_orphan_files` command](iceberg-remove-orphan-files). Equivalent session property is `remove_orphan_files_min_retention`. @@ -744,7 +744,7 @@ ALTER TABLE test_table EXECUTE expire_snapshots(retention_threshold => '7d') ``` The value for `retention_threshold` must be higher than or equal to -`iceberg.expire_snapshots.min-retention` in the catalog, otherwise the +`iceberg.expire-snapshots.min-retention` in the catalog, otherwise the procedure fails with a similar message: `Retention specified (1.00d) is shorter than the minimum retention configured in the system (7.00d)`. The default value for this property is `7d`. @@ -764,7 +764,7 @@ ALTER TABLE test_table EXECUTE remove_orphan_files(retention_threshold => '7d') ``` The value for `retention_threshold` must be higher than or equal to -`iceberg.remove_orphan_files.min-retention` in the catalog otherwise the +`iceberg.remove-orphan-files.min-retention` in the catalog otherwise the procedure fails with a similar message: `Retention specified (1.00d) is shorter than the minimum retention configured in the system (7.00d)`. The default value for this property is `7d`. diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java index 53f3966427ed0..b7793aead74d8 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java @@ -52,8 +52,8 @@ public class IcebergConfig public static final String EXTENDED_STATISTICS_CONFIG = "iceberg.extended-statistics.enabled"; public static final String EXTENDED_STATISTICS_DESCRIPTION = "Enable collection (ANALYZE) and use of extended statistics."; public static final String COLLECT_EXTENDED_STATISTICS_ON_WRITE_DESCRIPTION = "Collect extended statistics during writes"; - public static final String EXPIRE_SNAPSHOTS_MIN_RETENTION = "iceberg.expire_snapshots.min-retention"; - public static final String REMOVE_ORPHAN_FILES_MIN_RETENTION = "iceberg.remove_orphan_files.min-retention"; + public static final String EXPIRE_SNAPSHOTS_MIN_RETENTION = "iceberg.expire-snapshots.min-retention"; + public static final String REMOVE_ORPHAN_FILES_MIN_RETENTION = "iceberg.remove-orphan-files.min-retention"; private IcebergFileFormat fileFormat = PARQUET; private HiveCompressionCodec compressionCodec = ZSTD; @@ -305,6 +305,7 @@ public Duration getExpireSnapshotsMinRetention() } @Config(EXPIRE_SNAPSHOTS_MIN_RETENTION) + @LegacyConfig("iceberg.expire_snapshots.min-retention") @ConfigDescription("Minimal retention period for expire_snapshot procedure") public IcebergConfig setExpireSnapshotsMinRetention(Duration expireSnapshotsMinRetention) { @@ -319,6 +320,7 @@ public Duration getRemoveOrphanFilesMinRetention() } @Config(REMOVE_ORPHAN_FILES_MIN_RETENTION) + @LegacyConfig("iceberg.remove_orphan_files.min-retention") @ConfigDescription("Minimal retention period for remove_orphan_files procedure") public IcebergConfig setRemoveOrphanFilesMinRetention(Duration removeOrphanFilesMinRetention) { diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java index 15dabc756f5ac..aab9d6b1fc5f4 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java @@ -6218,7 +6218,7 @@ public void testExpireSnapshotsParameterValidation() "\\Qline 1:46: Unable to set catalog 'iceberg' table procedure 'EXPIRE_SNAPSHOTS' property 'retention_threshold' to ['33mb']: Unknown time unit: mb"); assertQueryFails( "ALTER TABLE nation EXECUTE EXPIRE_SNAPSHOTS (retention_threshold => '33s')", - "\\QRetention specified (33.00s) is shorter than the minimum retention configured in the system (7.00d). Minimum retention can be changed with iceberg.expire_snapshots.min-retention configuration property or iceberg.expire_snapshots_min_retention session property"); + "\\QRetention specified (33.00s) is shorter than the minimum retention configured in the system (7.00d). Minimum retention can be changed with iceberg.expire-snapshots.min-retention configuration property or iceberg.expire_snapshots_min_retention session property"); } @Test @@ -6356,7 +6356,7 @@ public void testRemoveOrphanFilesParameterValidation() "\\Qline 1:49: Unable to set catalog 'iceberg' table procedure 'REMOVE_ORPHAN_FILES' property 'retention_threshold' to ['33mb']: Unknown time unit: mb"); assertQueryFails( "ALTER TABLE nation EXECUTE REMOVE_ORPHAN_FILES (retention_threshold => '33s')", - "\\QRetention specified (33.00s) is shorter than the minimum retention configured in the system (7.00d). Minimum retention can be changed with iceberg.remove_orphan_files.min-retention configuration property or iceberg.remove_orphan_files_min_retention session property"); + "\\QRetention specified (33.00s) is shorter than the minimum retention configured in the system (7.00d). Minimum retention can be changed with iceberg.remove-orphan-files.min-retention configuration property or iceberg.remove_orphan_files_min_retention session property"); } @Test diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java index 9e6b13a1bdae3..9334299ba4a16 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConfig.java @@ -92,8 +92,8 @@ public void testExplicitPropertyMappings() .put("iceberg.projection-pushdown-enabled", "false") .put("iceberg.hive-catalog-name", "hive") .put("iceberg.format-version", "1") - .put("iceberg.expire_snapshots.min-retention", "13h") - .put("iceberg.remove_orphan_files.min-retention", "14h") + .put("iceberg.expire-snapshots.min-retention", "13h") + .put("iceberg.remove-orphan-files.min-retention", "14h") .put("iceberg.delete-schema-locations-fallback", "true") .put("iceberg.target-max-file-size", "1MB") .put("iceberg.idle-writer-min-file-size", "1MB")