Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
272 views
in Technique[技术] by (71.8m points)

java - Is there a function in HiveMetaStoreClient which will give me all Partitions of a hive-table?

I have tried some functions like getPartition, getPartitionsByNames, listPartitions. I need something like if i give the name of a partition column, then the function should return all the partitions of it existing in hdfs.

Example: Function(dbName, tableName, partitonColumnName) Output: 12345, 12346, 12347, 12348 It should return all partitions existing in hdfs

question from:https://stackoverflow.com/questions/65844451/is-there-a-function-in-hivemetastoreclient-which-will-give-me-all-partitions-of

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

HiveMetastoreClient has List<String> listPartitionNames(String dbName, String tblName, short max) method and List<Partition> listPartitions(String db_name, String tbl_name, short max_parts) method.

See listPartitions method.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...