armitage420 commented on code in PR #5539:
URL: https://github.com/apache/hive/pull/5539#discussion_r1915371634
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/PartitionIterable.java:
##########
@@ -173,6 +183,42 @@ public PartitionIterable(Hive db, Table table, Map<String,
String> partialPartit
this(db, table, partialPartitionSpec, batchSize, getColStats, false, null,
null);
}
+ public PartitionIterable(Hive db, Table table, int batchSize,
GetPartitionsRequest getPartitionsRequest)
+ throws HiveException, TException {
+ if (batchSize < 1) {
+ throw new HiveException("Invalid batch size for partition iterable.
Please use a batch size greater than 0");
+ }
+ this.currType = Type.LAZY_FETCH_PARTITIONS;
+ this.db = db;
+ this.table = table;
+ this.batchSize = batchSize;
+ this.getPartitionsRequest = getPartitionsRequest;
+ List<String> pVals = null;
+ if(getPartitionsRequest.isSetFilterSpec()){
+ pVals = this.getPartitionsRequest.getFilterSpec().getFilters();
+ }
+ if (pVals == null){
+ partitionNames = db.getPartitionNames(
+ table.getDbName(),table.getTableName(), (short) -1);
+ } else {
+ PartitionFilterMode filterMode =
getPartitionsRequest.getFilterSpec().getFilterMode();
Review Comment:
The switch cases does have the same conditions, while what the code is doing
for each cases are different.
`PartitionTree` was made for handling temp tables, along with their
partitions in HS2 itself(the very temp table and map of partition objects are
initialized, populated in the same class).
`PartitionIterable` on the other hand has to call upon (or just add if
provided based on cases) partition names from HMS instead to do batch
operations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]