ngsg commented on code in PR #5478:
URL: https://github.com/apache/hive/pull/5478#discussion_r2018603799
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java:
##########
@@ -385,17 +385,22 @@ public static int countOperatorsUpstream(Operator<?>
start, Set<Class<? extends
}
public static void setMemoryAvailable(final List<Operator<? extends
OperatorDesc>> operators,
- final long memoryAvailableToTask) {
- if (operators == null) {
+ final long memoryAvailable) {
+ if (operators == null || operators.isEmpty()) {
return;
}
+ final long memoryAvailablePerOperator = memoryAvailable / operators.size();
Review Comment:
I think we could use a number less than `operators.size()` since not all
operators require significant memory that should be managed by
`getMaxMemoryAvailable()`. For instance, we can likely ignore select and filter
operators, as they behave more like fire-and-forget operations and do not
consume much memory. Given that `OperatorDesc.getMaxMemoryAvailable()` is
referenced by MapJoin, ReduceSink (with TopN), and GroupBy (with Hash Aggregate
Mode), I think #MapJoin + #(RS with TopN) + #(GBY with HashMode) + 1(for the
rest) could be a candidate.
--
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]