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-28677: Implement direct sql for delete table/partition column stats #5587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wecharyu
Copy link
Contributor

What changes were proposed in this pull request?

Improve the performance of deleting column stats for wide table.

Why are the changes needed?

The JDO implementation of deleting column stats needs to retrieve the column stats objects, it could be slow if the table has many columns.

Does this PR introduce any user-facing change?

No.

Is the change a dependency upgrade?

No.

How was this patch tested?

Add some unit tests:

mvn test -Dtest.groups= -Dtest=org.apache.hadoop.hive.metastore.TestObjectStore#testPartitionStatisticsOps -pl :hive-standalone-metastore-server


public boolean deletePartitionColumnStats(String catName, String dbName, String tblName,
String partName, String colName, String engine) throws MetaException {
String sqlFilter = "" + PARTITIONS + ".\"PART_NAME\" = ? ";
Copy link
Contributor

Choose a reason for hiding this comment

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

Empty String can be removed from the value of sqlFilter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed.

return new GetHelper<Boolean>(catName, dbName, tableName, true, true) {
@Override
protected String describeResult() {
return "delete prtition column stats";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: partition spelling.

@Aggarwal-Raghav
Copy link
Contributor

LGTM +1 (non-binding)

Copy link
Contributor

@zhangbutao zhangbutao left a comment

Choose a reason for hiding this comment

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

+1 LGTM

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.

4 participants