Skip to content

HIVE-25500: Switch back to alter_partition(s) in HMS client for Hive 2.3.x #2618

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

Merged
merged 2 commits into from
Sep 8, 2021

Conversation

cxzl25
Copy link
Contributor

@cxzl25 cxzl25 commented Sep 6, 2021

What changes were proposed in this pull request?

Use alter_partition, alter_partitions when EnvironmentContext is null.

Why are the changes needed?

HIVE-12730 uses alter_partition_with_environment_context and alter_partitions_with_environment_context instead of alter_partition and alter_partitions when the EnvironmentContext is null.
This causes the client version to be greater than 2.1 to connect to server<2.1, and this error will occur.

Caused by: org.apache.thrift.TApplicationException: Invalid method name: 'alter_partitions_with_environment_context'
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:79)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_partitions_with_environment_context(ThriftHiveMetastore.java:2843)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_partitions_with_environment_context(ThriftHiveMetastore.java:2827)
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_partitions(HiveMetaStoreClient.java:1524)

Does this PR introduce any user-facing change?

No.

How was this patch tested?

exist UT

@cxzl25 cxzl25 changed the base branch from branc-2.3 to branch-2.3 September 6, 2021 08:58
@cxzl25
Copy link
Contributor Author

cxzl25 commented Sep 6, 2021

@sunchao Help review when you have time. Thanks.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cxzl25 ! this is a good catch and it LGTM. Could you open another one for branch-3.1 as well? Ideally we should also fix this in master but seems the code path has changed a lot there.

@sunchao sunchao changed the title Hive-25500: Switch back to alter_partition(s) in HMS client for Hive 2.3.x HIVE-25500: Switch back to alter_partition(s) in HMS client for Hive 2.3.x Sep 7, 2021
@cxzl25
Copy link
Contributor Author

cxzl25 commented Sep 8, 2021

Thanks @cxzl25 ! this is a good catch and it LGTM. Could you open another one for branch-3.1 as well? Ideally we should also fix this in master but seems the code path has changed a lot there.

Submitted a PR (#2623) on branch3.1 .
master branch: HIVE-19820 uses alter_partitions_req instead of alter_partitions .

@sunchao sunchao merged commit efd5212 into apache:branch-2.3 Sep 8, 2021
@sunchao
Copy link
Member

sunchao commented Sep 8, 2021

Merged to branch-2.3 Thanks @cxzl25 !

PACordonnier pushed a commit to TOSIT-IO/hive that referenced this pull request Nov 9, 2023
rpignolet pushed a commit to TOSIT-IO/hive that referenced this pull request Nov 10, 2023
Pierrotws pushed a commit to TOSIT-IO/hive that referenced this pull request Jan 13, 2024
Pierrotws pushed a commit to TOSIT-IO/hive that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants