-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove HiveConfig from Iceberg module #12506
Remove HiveConfig from Iceberg module #12506
Conversation
ba87988
to
fbcc078
Compare
fbcc078
to
4e2b9c2
Compare
@@ -107,7 +107,7 @@ public HiveMetadataFactory( | |||
hiveConfig.getWritesToNonManagedTablesEnabled(), | |||
hiveConfig.getCreatesOfNonManagedTablesEnabled(), | |||
hiveConfig.isDeleteSchemaLocationsFallback(), | |||
hiveConfig.isTranslateHiveViews(), | |||
metastoreConfig.isTranslateHiveViews(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not metastore-related. isTranslateHiveViews
is used in HiveMetadata.
What would happen if you move this back to HiveConfig?
requireNonNull(metastoreConfig, "metastoreConfig is null"); | ||
checkArgument(!metastoreConfig.isHideDeltaLakeTables(), "Hiding Delta Lake tables is not supported"); // TODO | ||
this.translateHiveViews = metastoreConfig.isTranslateHiveViews(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this use-place is the reason why you moved the config from HiveConfig
to metastoreConfig
.
However, we don't need this configurable in iceberg. There is no concept of "hive views" in Iceberg.
- we may be able to solve this using a technique like
@MaxDomainCompactionThreshold
- add a
TestIcebergPlugin
test that configuring connector withhive.hive-views.enabled
fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok my bad, I was pretty sure iceberg needs this. Thanks
4e2b9c2
to
a004720
Compare
build is failing locally. Do note that the branch has conflicts with |
df9d6b6
to
5f1dab8
Compare
@@ -92,6 +94,7 @@ public void setup(Binder binder) | |||
configBinder(binder).bindConfig(DeltaLakeConfig.class); | |||
configBinder(binder).bindConfig(HiveConfig.class); | |||
binder.bind(MetastoreConfig.class).toInstance(new MetastoreConfig()); // currently not configurable | |||
newOptionalBinder(binder, Key.get(boolean.class, TranslateHiveViews.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like extension point, but Delta doesn't need to create extension points. At best, Hive would do this.
what about
binder.bind(Key.get(boolean.class, TranslateHiveViews.class)).toInstance(false);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok, I see now. thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tough I guess it is not needed for delta lake as there is still hive config there
} | ||
|
||
@LegacyConfig({"hive.views-execution.enabled", "hive.translate-hive-views"}) | ||
@Config("hive.hive-views.enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I didn't understand the idea...
@@ -92,7 +93,8 @@ public HiveMetadataFactory( | |||
Set<SystemTableProvider> systemTableProviders, | |||
HiveMaterializedViewMetadataFactory hiveMaterializedViewMetadataFactory, | |||
AccessControlMetadataFactory accessControlMetadataFactory, | |||
DirectoryLister directoryLister) | |||
DirectoryLister directoryLister, | |||
@TranslateHiveViews Optional<Boolean> translateHiveViews) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Optional
? it's always either true or false
@TranslateHiveViews Optional<Boolean> translateHiveViews) | |
@TranslateHiveViews boolean translateHiveViews) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, this class takes HiveConfig hiveConfig
, so if the fields goes back there (as it should), remove the new paramater.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep I 've got it now
MetastoreConfig metastoreConfig, | ||
@TranslateHiveViews Optional<Boolean> translateHiveViews, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Optional
? it's always either true or false
@TranslateHiveViews Optional<Boolean> translateHiveViews, | |
@TranslateHiveViews boolean translateHiveViews) |
"test", | ||
Map.of( | ||
"iceberg.catalog.type", "HIVE_METASTORE", | ||
"hive.hive-views.enabled", "true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant so that the test always uses a correct config property name
d42c963
to
358abb3
Compare
@@ -48,8 +49,8 @@ | |||
public void configure(Binder binder) | |||
{ | |||
binder.bind(IcebergTransactionManager.class).in(Scopes.SINGLETON); | |||
binder.bind(Key.get(boolean.class, TranslateHiveViews.class)).toInstance(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is Thrift specific, it can go in IcebergHiveMetastoreCatalogModule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see thjis added to IcebergHiveMetastoreCatalogModule.java
but not removed here
358abb3
to
f58e8b1
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeModule.java
Show resolved
Hide resolved
new MetastoreConfig(), | ||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metastoreConfig, | ||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new HiveConfig().isTranslateHiveViews()
new MetastoreConfig(), | ||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new HiveConfig().isTranslateHiveViews()
@@ -154,7 +153,7 @@ private ThriftHiveMetastore createThriftHiveMetastore() | |||
private static ThriftHiveMetastore createThriftHiveMetastore(ThriftMetastoreClient client) | |||
{ | |||
MetastoreLocator metastoreLocator = new MockMetastoreLocator(client); | |||
return new ThriftHiveMetastore(metastoreLocator, new HiveConfig(), new MetastoreConfig(), new ThriftMetastoreConfig(), HDFS_ENVIRONMENT, false); | |||
return new ThriftHiveMetastore(metastoreLocator, new MetastoreConfig(), false, new ThriftMetastoreConfig(), HDFS_ENVIRONMENT, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new HiveConfig().isTranslateHiveViews()
new MetastoreConfig(), | ||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new HiveConfig().isTranslateHiveViews()
@@ -48,8 +49,8 @@ | |||
public void configure(Binder binder) | |||
{ | |||
binder.bind(IcebergTransactionManager.class).in(Scopes.SINGLETON); | |||
binder.bind(Key.get(boolean.class, TranslateHiveViews.class)).toInstance(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see thjis added to IcebergHiveMetastoreCatalogModule.java
but not removed here
@@ -29,6 +30,8 @@ | |||
|
|||
public class TestIcebergPlugin | |||
{ | |||
private static final String HIVE_VIEWS_ENABLED = "hive.hive-views.enabled"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant has value only if used in @Config
annotation value of the io.trino.plugin.hive.HiveConfig#setTranslateHiveViews
method.
f58e8b1
to
b11f77f
Compare
CI #11848 |
} | ||
|
||
@LegacyConfig("hive.target-max-file-size") | ||
@Config("iceberg.target-max-file-size") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will submit a pr. Thanks for pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Related issues, pull requests, and links
Documentation
( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: