-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Remove HiveConfig from Iceberg module #12506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ | |
| public class HiveConfig | ||
| { | ||
| private static final Splitter SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings(); | ||
| public static final String HIVE_VIEWS_ENABLED = "hive.hive-views.enabled"; | ||
|
|
||
| private boolean singleStatementWritesOnly; | ||
|
|
||
|
|
@@ -771,7 +772,7 @@ public boolean isTranslateHiveViews() | |
| } | ||
|
|
||
| @LegacyConfig({"hive.views-execution.enabled", "hive.translate-hive-views"}) | ||
| @Config("hive.hive-views.enabled") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why removed?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because I didn't understand the idea... |
||
| @Config(HIVE_VIEWS_ENABLED) | ||
| @ConfigDescription("Experimental: Allow translation of Hive views into Trino views") | ||
| public HiveConfig setTranslateHiveViews(boolean translateHiveViews) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package io.trino.plugin.hive.metastore.thrift; | ||
|
|
||
| import javax.inject.Qualifier; | ||
|
|
||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| import static java.lang.annotation.ElementType.FIELD; | ||
| import static java.lang.annotation.ElementType.METHOD; | ||
| import static java.lang.annotation.ElementType.PARAMETER; | ||
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
|
||
| @Retention(RUNTIME) | ||
| @Target({FIELD, PARAMETER, METHOD}) | ||
| @Qualifier | ||
| public @interface TranslateHiveViews | ||
| { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ | |
|
|
||
| import io.airlift.configuration.Config; | ||
| import io.airlift.configuration.ConfigDescription; | ||
| import io.airlift.configuration.LegacyConfig; | ||
| import io.airlift.units.DataSize; | ||
| import io.airlift.units.Duration; | ||
| import io.trino.plugin.hive.HiveCompressionCodec; | ||
|
|
||
|
|
@@ -24,6 +26,7 @@ | |
|
|
||
| import java.util.Optional; | ||
|
|
||
| import static io.airlift.units.DataSize.Unit.GIGABYTE; | ||
| import static io.trino.plugin.hive.HiveCompressionCodec.ZSTD; | ||
| import static io.trino.plugin.iceberg.CatalogType.HIVE_METASTORE; | ||
| import static io.trino.plugin.iceberg.IcebergFileFormat.ORC; | ||
|
|
@@ -50,6 +53,11 @@ public class IcebergConfig | |
| private int formatVersion = FORMAT_VERSION_SUPPORT_MAX; | ||
| private Duration expireSnapshotsMinRetention = new Duration(7, DAYS); | ||
| private Duration removeOrphanFilesMinRetention = new Duration(7, DAYS); | ||
| private DataSize targetMaxFileSize = DataSize.of(1, GIGABYTE); | ||
| // This is meant to protect users who are misusing schema locations (by | ||
| // putting schemas in locations with extraneous files), so default to false | ||
| // to avoid deleting those files if Trino is unable to check. | ||
| private boolean deleteSchemaLocationsFallback; | ||
|
|
||
| public CatalogType getCatalogType() | ||
| { | ||
|
|
@@ -235,4 +243,32 @@ public IcebergConfig setRemoveOrphanFilesMinRetention(Duration removeOrphanFiles | |
| this.removeOrphanFilesMinRetention = removeOrphanFilesMinRetention; | ||
| return this; | ||
| } | ||
|
|
||
| public DataSize getTargetMaxFileSize() | ||
| { | ||
| return targetMaxFileSize; | ||
| } | ||
|
|
||
| @LegacyConfig("hive.target-max-file-size") | ||
| @Config("iceberg.target-max-file-size") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will submit a pr. Thanks for pointing it out
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| @ConfigDescription("Target maximum size of written files; the actual size may be larger") | ||
| public IcebergConfig setTargetMaxFileSize(DataSize targetMaxFileSize) | ||
| { | ||
| this.targetMaxFileSize = targetMaxFileSize; | ||
| return this; | ||
| } | ||
|
|
||
| public boolean isDeleteSchemaLocationsFallback() | ||
| { | ||
| return this.deleteSchemaLocationsFallback; | ||
| } | ||
|
|
||
| @LegacyConfig("hive.delete-schema-locations-fallback") | ||
| @Config("iceberg.delete-schema-locations-fallback") | ||
| @ConfigDescription("Whether schema locations should be deleted when Trino can't determine whether they contain external files.") | ||
| public IcebergConfig setDeleteSchemaLocationsFallback(boolean deleteSchemaLocationsFallback) | ||
| { | ||
| this.deleteSchemaLocationsFallback = deleteSchemaLocationsFallback; | ||
| return this; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.