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

Hive metastore 4.0.1 remove deprecated thrift APIs #1222

Open
mattheusv opened this issue Oct 7, 2024 · 2 comments
Open

Hive metastore 4.0.1 remove deprecated thrift APIs #1222

mattheusv opened this issue Oct 7, 2024 · 2 comments

Comments

@mattheusv
Copy link

mattheusv commented Oct 7, 2024

Apache Iceberg version

0.7.1

Please describe the bug 🐞

Starting at version 4.0.1, Hive metastore removed deprecated thrift APIs that py-iceberg is currently using. When trying to create a table with catalog.create_table_transaction using Hive metastore 4.0.1, py-iceberg raise an unexpected thrift.Thrift.TApplicationException: Invalid method name: 'get_table' error:

  File "iceberg.py", line 102, in create_table
    with self.catalog.create_table_transaction(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyiceberg/table/__init__.py", line 289, in __exit__
    self.commit_transaction()
  File "/usr/local/lib/python3.12/site-packages/pyiceberg/table/__init__.py", line 766, in commit_transaction
    self._table._do_commit(  # pylint: disable=W0212
  File "/usr/local/lib/python3.12/site-packages/pyiceberg/table/__init__.py", line 1638, in _do_commit
    response = self.catalog._commit_table(  # pylint: disable=W0212
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyiceberg/catalog/hive.py", line 457, in _commit_table
    hive_table = self._get_hive_table(open_client, database_name, table_name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyiceberg/catalog/hive.py", line 331, in _get_hive_table
    return open_client.get_table(dbname=database_name, tbl_name=table_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hive_metastore/ThriftHiveMetastore.py", line 4242, in get_table
    return self.recv_get_table()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hive_metastore/ThriftHiveMetastore.py", line 4260, in recv_get_table
    raise x
thrift.Thrift.TApplicationException: Invalid method name: 'get_table'

This error seems related with this Hive PR(apache/hive#3599) that removed the get_table method

@kevinjqliu
Copy link
Contributor

Thanks for reporting this issue!

I know there's an option to set hive.hive2-compatible to be compatible with Hive 2.x
https://py.iceberg.apache.org/configuration/#hive-catalog

Perhaps we need to do something similar for Hive 4.x

Do you know if there's a migration guide on interacting with Hive 4.x?

@kevinjqliu
Copy link
Contributor

Ah we use hive 4.0.0 in the integration tests

hive:
build: hive/
container_name: hive

FROM apache/hive:4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants