Reintroduce HiveTableRedirectionsProvider interface#19161
Reintroduce HiveTableRedirectionsProvider interface#19161architgyl wants to merge 13 commits intotrinodb:masterfrom
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
|
For a little more context on why this is needed ...
However we have reintroduced it here with a slightly different interface, specifically to be able to tackle the situation where we may want to perform redirection even though the table no longer exists in HMS. The previous implementation required the table to exist in HMS and forced no-redirection if it did not, limiting the flexibility of a provider implementation to perform redirection regardless of the state of HMS. This can be useful, for example, if an external metadata store controls the redirection. |
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveTableRedirectionsProvider.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
|
The new tests seem to be failing, can you take a look at them @architgyl ? |
Fixed the test cases. |
xkrogen
left a comment
There was a problem hiding this comment.
This is looking good to me except for the minor comments and confirming about the importance of the redirect short-circuit behavior.
cc @findepi @findinpath @ebyhr @alexjo2144 since you have been involved in previous PRs related to HiveTableRedirectionsProvider (e.g. #12252) and the Hive redirection logic.
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
| Optional<String> icebergCatalogName = getIcebergCatalogName(session); | ||
| Optional<String> deltaLakeCatalogName = getDeltaLakeCatalogName(session); | ||
| Optional<String> hudiCatalogName = getHudiCatalogName(session); | ||
|
|
||
| if (icebergCatalogName.isEmpty() && deltaLakeCatalogName.isEmpty() && hudiCatalogName.isEmpty()) { | ||
| return Optional.empty(); | ||
| } | ||
|
|
There was a problem hiding this comment.
With this we lost the ability to short-circuit the redirection lookup when no redirect catalogs are configured, when using the default behavior. That was added recently in 4b4bb6f (#18341)
@findepi was that behavior important? I see it was added as part of a broader PR
I think we could preserve this behavior by adding a method to the HiveTableRedirectionsProvider interface like boolean mayRedirect() which says if the provider will possibly redirect -- then we could leverage it here for short-circuiting. But not sure if this is overkill.
plugin/trino-hive/src/test/java/io/trino/plugin/hive/AbstractTestHive.java
Outdated
Show resolved
Hide resolved
|
@architgyl , @xkrogen please do rework a bit the description of the PR. Specifying #12252 PR for related PRs would also be a helpful context for eventual reviewers. |
This remains supported.
Trino is design to provide best out of the box experience and we are committed to evolving it. And this requires removing functionalities that are not used. Trino is not a library. Hive connector is not a library and should not be viewed as such. |
Agreed -- @architgyl can we phrase this as "including but not limited to open-source formats like Hudi, Iceberg, and Delta"? Hopefully this will better convey the intent.
Thanks for the perspective here @findepi ! I am trying to square it with what I see with regards to other similar interfaces. Please excuse me if my questions are naive as my involvement with Trino is relatively new. In #2603 it was made possible for administrators to specify additional modules when configuring a My expectation is that, as enterprises are increasingly moving away from Hive both as a table format and as a metadata catalog, there will be an increased demand for the ability to provide a smooth transition onto other formats/catalogs with some customized logic controlling the routing. cc @phd3 @losipiuk @electrum for perspectives on this -- since you had some involvement with the original PR that added the |
|
We have to look at these on a case by case basis, but this seems like a clear win to me, as the interface moves the logic out of the ~4000 line |
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java
Outdated
Show resolved
Hide resolved
|
Gentle reminder if someone can help take a look at the PR. |
|
cc @findepi @findinpath @ebyhr @alexjo2144 @phd3 @losipiuk @electrum - anyone able/willing to review this? |
|
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
|
👋 @findepi @findinpath @ebyhr @alexjo2144 @phd3 @losipiuk @electrum could someone please help out here.. |
|
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
|
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
|
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
|
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
|
Reopening again and adding stale-ignore label so that @electrum can follow up |
Description
The HiveTableRedirectionsProvider interface has been reintroduced with some modifications to enhance its usability in addressing a broader range of use cases. Initially, this interface provided a valuable entry point for administrators to configure redirections from Hive to various table formats, including but not limited to open-source formats like Hudi, Iceberg, and Delta. However, the enhanced interface aims to provide even greater flexibility:
Reference PR which removed HiveTableRedirectionsProvider - #12252
Testing
./mvnw clean install -DskipTestsis successful.Also added new unit tests for the following scenarios:
Release notes
(X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: