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

Throw meaningful exception when intending to update statistics for missing partition #18401

Merged

Conversation

findinpath
Copy link
Contributor

@findinpath findinpath commented Jul 25, 2023

Description

Avoid providing misleading failure cause to the user when trying to drop the statistics for a partition which doesn't exist

Caused by: io.trino.spi.TrinoException: Metastore returned multiple partitions for name: p_varchar=partnotfound/p_integer=999
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.updatePartitionStatistics(ThriftHiveMetastore.java:598)
	at io.trino.plugin.hive.metastore.thrift.BridgingHiveMetastore.lambda$updatePartitionStatistics$1(BridgingHiveMetastore.java:136)
	at com.google.common.collect.SingletonImmutableBiMap.forEach(SingletonImmutableBiMap.java:68)
	at io.trino.plugin.hive.metastore.thrift.BridgingHiveMetastore.updatePartitionStatistics(BridgingHiveMetastore.java:136)
	at io.trino.plugin.hive.metastore.HiveMetastore.updatePartitionStatistics(HiveMetastore.java:58)
	at io.trino.plugin.hive.metastore.ForwardingHiveMetastore.updatePartitionStatistics(ForwardingHiveMetastore.java:100)
	at io.trino.plugin.hive.metastore.cache.CachingHiveMetastore.updatePartitionStatistics(CachingHiveMetastore.java:720)
	at io.trino.plugin.hive.metastore.cache.CachingHiveMetastore.updatePartitionStatistics(CachingHiveMetastore.java:720)
	at io.trino.plugin.hive.HiveMetastoreClosure.updatePartitionStatistics(HiveMetastoreClosure.java:141)
	at io.trino.plugin.hive.procedure.DropStatsProcedure.lambda$doDropStats$1(DropStatsProcedure.java:125)

Additional context and related issues

Release notes

(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jul 25, 2023
@findinpath findinpath self-assigned this Jul 25, 2023
@findinpath findinpath added the hive Hive connector label Jul 25, 2023
@findinpath findinpath force-pushed the findinpath/hive-drop-stats-missing-partition branch from 978a56d to 8509375 Compare July 25, 2023 09:11
@findinpath findinpath requested review from homar and ebyhr July 25, 2023 09:12
@findinpath
Copy link
Contributor Author

CI hit #18408

@findinpath findinpath changed the title Short-circuit partition update statistics mechanism for missing partition Throw meaningful exception when intending to update statistics for missing partition Jul 26, 2023
@findinpath findinpath force-pushed the findinpath/hive-drop-stats-missing-partition branch from 82030d8 to 1f2b328 Compare July 26, 2023 14:49
@ebyhr ebyhr force-pushed the findinpath/hive-drop-stats-missing-partition branch from 1f2b328 to aa88c09 Compare July 26, 2023 22:16
@ebyhr ebyhr merged commit a90196a into trinodb:master Jul 26, 2023
@ebyhr
Copy link
Member

ebyhr commented Jul 26, 2023

Modified the commit title and merged.

@ebyhr ebyhr added this to the 423 milestone Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector
Development

Successfully merging this pull request may close these issues.

3 participants