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

Insert into Hive transactional table fails with HMS 3.1.2: Invalid method name alter_table_req #7310

Closed
yingdam opened this issue Mar 17, 2021 · 3 comments · Fixed by #12771
Assignees
Labels
bug Something isn't working

Comments

@yingdam
Copy link

yingdam commented Mar 17, 2021

Hi, guys! I want to test Hive transactional table and ACID function with Trino v353 and HMS 3.1.2 (Apache Hive official distribution).
I created a table with following sql:
create table sample (a int, b int) with (transactional='true');

after that I tried to insert into this table with sql:
insert into sample values row(1, 2)
and got the exception org.apache.thrift.TApplicationException: Invalid method name: 'alter_table_req'
The attach image is stacktrace snapshot.
image

@findepi said it may be the compatible problem with Apache Hive distribution (“vanilla”).

@findepi findepi changed the title Got Invalid method exception when insert data into Hive transactional table Insert into Hive transactional table fails with HMS 3.1.2: Invalid method name alter_table_req Mar 17, 2021
@findepi findepi added the bug Something isn't working label Mar 17, 2021
@kakella
Copy link

kakella commented Mar 26, 2021

I am getting the same error using following Dockerfile

FROM ghcr.io/trinodb/testing/hive3.1-hive:latest
COPY overrides /

where overrides folder has my hive-site.xml with settings appropriate for my MinIO connectivity. Exception is

2021-03-25T18:25:30.164-0700	WARN	query-execution-4	io.trino.plugin.hive.metastore.SemiTransactionalHiveMetastore	Rolling back due to metastore commit failure: Invalid method name: 'alter_table_req'
2021-03-25T18:25:30.350-0700	ERROR	transaction-finishing-1	io.trino.transaction.InMemoryTransactionManager	Connector threw exception on abort
java.lang.IllegalStateException: Tried to rollback buffered metastore operations after transaction has been committed/aborted
	at io.trino.plugin.hive.metastore.SemiTransactionalHiveMetastore.rollback(SemiTransactionalHiveMetastore.java:1185)
	at io.trino.plugin.hive.HiveMetadata.rollback(HiveMetadata.java:2953)
	at io.trino.plugin.hive.HiveConnector.rollback(HiveConnector.java:222)
	at io.trino.transaction.InMemoryTransactionManager$TransactionMetadata$ConnectorTransactionMetadata.abort(InMemoryTransactionManager.java:601)
	at io.trino.transaction.InMemoryTransactionManager$TransactionMetadata.safeAbort(InMemoryTransactionManager.java:531)
	at io.trino.transaction.InMemoryTransactionManager$TransactionMetadata.lambda$abortInternal$9(InMemoryTransactionManager.java:524)
	at io.trino.transaction.InMemoryTransactionManager$TransactionMetadata$$Lambda$7798/0x0000000000000000.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at io.airlift.concurrent.BoundedExecutor.drainQueue(BoundedExecutor.java:80)
	at io.airlift.concurrent.BoundedExecutor$$Lambda$6875/0x0000000000000000.run(Unknown Source)
	at io.trino.$gen.Trino_dev____20210326_012103_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:836)

In my test it looks like the data got created in storage, although the table itself shows 0 rows inserted
Screen Shot 2021-03-25 at 9 22 02 PM

@georgewfisher
Copy link

I am getting this same issue. HMS 3.1.2

@divyanshidm
Copy link

I am getting the same issue, Hive version is above 3, querying with trino.
UPDATE table-name SET basin = 'TAO' WHERE basin='OAT';
Query 20230206_095844_00009_fkgk2 failed: Invalid method name: 'alter_table_req'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment