How to query table partitions list using

120 Views Asked by At

I need to programmatically query Qubole for the list of partitions for a Hive table. I can do this by calling the correct API endpoint as described here, but I would like to use the qds-sdj-java client to do this (I am already using it for other things).

In looking through the client's Javadoc API documentation, I don't see an option for doing this. Is there a way and I am just overlooking it? Is calling the endpoint directly the only option?

3

There are 3 best solutions below

1
Disha On

You can refer to Hive Command Example Using QDS-SDK where you can pass show partitions table_name; query for your Hive Table. Hope this is helpful.

0
GreenGiant On

It turns out that the published Javadocs for the QDS Client are simply out of date. The actual library itself supports list partitions in version 1.1.0.

InvokableBuilder<List<TablePartitionsAndLocation>> viewTablePartitionsAndLocation(String tableName);
0
Disha On

Oh, Got it. Yes, We will update the javadocs for the QDS Client. Glad that you found the solution you were looking for.