Skip to content
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

Iceberg Rest Unable to list tables for Hive Metastore with mixed Hive and Iceberg #6382

Open
metalshanked opened this issue Jan 28, 2025 · 7 comments · May be fixed by #6396
Open

Iceberg Rest Unable to list tables for Hive Metastore with mixed Hive and Iceberg #6382

metalshanked opened this issue Jan 28, 2025 · 7 comments · May be fixed by #6396
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@metalshanked
Copy link

Version

main branch

Describe what's wrong

I am using Trino to connect to Gravitino Iceberg Rest Server backed by a Hive Metastore.
The hive metastore can have native hive and iceberg tables both.

Below is the error in Trino and similar error in Gravitino logs too " Unable to process: hive is not support view"

Error message and/or stacktrace

Caused by: org.apache.iceberg.exceptions.RESTException: Unable to process: hive is not support view
	at org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:224)
	at org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:180)
	at org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:166)
	at org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:211)
	at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:323)
	at org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:262)
	at org.apache.iceberg.rest.HTTPClient.get(HTTPClient.java:358)
	at org.apache.iceberg.rest.RESTClient.get(RESTClient.java:96)
	at org.apache.iceberg.rest.RESTSessionCatalog.listViews(RESTSessionCatalog.java:1133)
	at io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog.lambda$listTables$3(TrinoRestCatalog.java:218)
	at io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog.listTableIdentifiers(TrinoRestCatalog.java:243)
	... 49 more

How to reproduce

0.8.0

Additional context

No response

@metalshanked metalshanked added the bug Something isn't working label Jan 28, 2025
@FANNG1
Copy link
Contributor

FANNG1 commented Feb 2, 2025

Seems Trino treat both Iceberg table and view to Trino tables. Hive catalog doesn't support view operations until 1.7.0 in apache/iceberg#9852, while Gravitino still uses Iceberg 1.5.2. There may be two solutions:

  1. return an empty list when listing view for the catalog doesn't support view operations.
  2. upgrade Iceberg lib to 1.7.x, there maybe JDK compatibility problem, tracked in [Subtask] upgrade Iceberg version to 1.7 in Iceberg REST server version #6337

@FANNG1
Copy link
Contributor

FANNG1 commented Feb 2, 2025

For solution one, suggest solution in IcebergCatalogWrapper, and welcome contribute.

  public ListTablesResponse listView(Namespace namespace) {
    if (!catalog instanceof ViewCatalog) {
       // return empty table list
    }
    return CatalogHandlers.listViews(getViewCatalog(), namespace);
  }

@FANNG1 FANNG1 added help wanted Extra attention is needed good first issue Good for newcomers labels Feb 2, 2025
@FANNG1
Copy link
Contributor

FANNG1 commented Feb 2, 2025

another more general way is to export Iceberg server capabilities in Iceberg REST config endpoint, but this works in Iceberg 1.7 in apache/iceberg#10929.

@metalshanked
Copy link
Author

Thanks for the info. Seems like path to iceberg 1.7 is best for a long term approach. Somehow, if Gravitino needs to update JDK and make it work.

@FANNG1
Copy link
Contributor

FANNG1 commented Feb 2, 2025

Thanks for the info. Seems like path to iceberg 1.7 is best for a long term approach. Somehow, if Gravitino needs to update JDK and make it work.

Yes, this means Gravitino drops the support for JDK 8.

@FANNG1
Copy link
Contributor

FANNG1 commented Feb 5, 2025

@metalshanked , should you share the Trino version and Iceberg version you are using? Iceberg library does some compatibility works to avoid the unexcepted exceptions when listing views.

@metalshanked
Copy link
Author

metalshanked commented Feb 5, 2025

Hi @FANNG1 . I was using the latest Trino version (469). I also tried with older version (459).
I am using the Trino official Docker image.

Trino currently uses 1.7.1 but will up upgraded to 1.8 in the near future looks like

https://github.com/trinodb/trino/blob/3b53eee3c4cef19ea7c0aa8a20ca5987a7cd313e/pom.xml#L201

Future --> trinodb/trino#24713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
2 participants