-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-28059: Iceberg REST Catalog #5145
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
Conversation
- add CatalogClass conf to instantiate a HiveCatalog (thrift client); - added metrics;
- add CatalogClass conf to instantiate a HiveCatalog (thrift client); - added metrics;
- Introduce HiveActor abstract class that captures all methods needed by the (Iceberg) catalog to interact with Hive (HMS); - Implement thrift-client (HiveCatalogActor) and embedded client (HMSActor); - Removed property specifying catalog implementation; - Added property specifying HiveActor implementation class (hive.iceberg.catalog.actor.class); - Refactored tests accordingly;
- Introduce HiveActor abstract class that captures all methods needed by the (Iceberg) catalog to interact with Hive (HMS); - Implement thrift-client (HiveCatalogActor) and embedded client (HMSActor); - Removed property specifying catalog implementation; - Added property specifying HiveActor implementation class (hive.iceberg.catalog.actor.class); - Refactored tests accordingly;
- Introduce HiveActor abstract class that captures all methods needed by the (Iceberg) catalog to interact with Hive (HMS); - Implement thrift-client (HiveCatalogActor) and embedded client (HMSActor); - Removed property specifying catalog implementation; - Added property specifying HiveActor implementation class (hive.iceberg.catalog.actor.class); - Refactored tests accordingly;
| "hive.metastore.catalog.servlet.path", "icecli", | ||
| "Catalog servlet path component of URL endpoint." | ||
| ), | ||
| CATALOG_SERVLET_PORT("hive.metastore.catalog.servlet.port", |
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.
Please use more appropriate name here. I could not find out neither from the name, nor from the description this property is for Iceberg Rest Server.
| "hive.metastore.properties.namespaces", "", | ||
| "Property-maps namespace map; a JSON map where keys are namespace names, values namespace" + | ||
| "class and/or static factory method"), | ||
| CATALOG_SERVLET_PATH("hive.metastore.catalog.servlet.path", |
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.
Please use more appropriate name here. I could not find out neither from the name, nor from the description this property is for Iceberg Rest Server
| " 0 will let the system determine the catalog server port," + | ||
| " positive value will be used as-is." | ||
| ), | ||
| CATALOG_SERVLET_AUTH("hive.metastore.catalog.servlet.auth", |
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.
Please use more appropriate name here. I could not find out neither from the name, nor from the description this property is for Iceberg Rest Server
| import org.slf4j.LoggerFactory; | ||
|
|
||
|
|
||
| public class HMSCatalogServer { |
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 think HMSRESTCatalogServer would be better.
| * The RESTCatalogServlet provides a servlet implementation used in combination with a | ||
| * RESTCatalogAdaptor to proxy the REST Spec to any Catalog implementation. | ||
| */ | ||
| public class HMSCatalogServlet extends HttpServlet { |
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 think HMSRESTCatalogServlet would be better.
| * Original @ https://github.com/apache/iceberg/blob/main/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java | ||
| * Adaptor class to translate REST requests into {@link Catalog} API calls. | ||
| */ | ||
| public class HMSCatalogAdapter implements RESTClient { |
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 think HMSRESTCatalogAdapter would be better.
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class HMSCatalogActor implements HiveActor { |
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 think HMSRESTCatalogActor would be better.
zratkai
left a comment
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.
Please check my comments!
Will do :-) |
What changes were proposed in this pull request?
This is a basic implementation of the Iceberg REST Catalog as a service embedded within HMS.
Why are the changes needed?
For Hive users that have started using Iceberg to store data and want to expose those same tables to external query engines, implementing the Iceberg REST catalog embedded within HMS allows an easy upgrade and deployment path.
Although a dedicated service to host the REST catalog is certainly desirable, it also implies deploying and managing another service.
Does this PR introduce any user-facing change?
It does since HMS then 'hosts' a servlet that implements the Iceberg REST Catalog API.
Is the change a dependency upgrade?
No.
How was this patch tested?
Unit tests.