gianm commented on code in PR #16002:
URL: https://github.com/apache/druid/pull/16002#discussion_r1509415270


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/error/BroadcastTablesTooLargeFault.java:
##########
@@ -68,12 +78,37 @@ public boolean equals(Object o)
       return false;
     }
     BroadcastTablesTooLargeFault that = (BroadcastTablesTooLargeFault) o;
-    return maxBroadcastTablesSize == that.maxBroadcastTablesSize;
+    return maxBroadcastTablesSize == that.maxBroadcastTablesSize
+           && configuredJoinAlgorithm == that.configuredJoinAlgorithm;
   }
 
   @Override
   public int hashCode()
   {
-    return Objects.hash(super.hashCode(), maxBroadcastTablesSize);
+    return Objects.hash(super.hashCode(), maxBroadcastTablesSize, 
configuredJoinAlgorithm);
+  }
+
+  private static String makeMessage(final long maxBroadcastTablesSize, final 
JoinAlgorithm configuredJoinAlgorithm)
+  {
+    if (configuredJoinAlgorithm == null || configuredJoinAlgorithm == 
JoinAlgorithm.BROADCAST) {
+      return StringUtils.format(
+          "Size of broadcast tables in JOIN exceeds reserved memory limit "
+          + "(memory reserved for broadcast tables = [%,d] bytes). "
+          + "Increase available memory, or set [%s: %s] in query context to 
use a shuffle-based join.",
+          maxBroadcastTablesSize,
+          PlannerContext.CTX_SQL_JOIN_ALGORITHM,
+          JoinAlgorithm.SORT_MERGE.toString()
+      );
+    } else {
+      return StringUtils.format(
+          "Size of broadcast tables in JOIN exceeds reserved memory limit "

Review Comment:
   Yes, good point, I lost that part by accident. Added it back.



-- 
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]

Reply via email to