gianm commented on a change in pull request #9111: Add HashJoinSegment, a 
virtual segment for joins.
URL: https://github.com/apache/druid/pull/9111#discussion_r366011073
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/lookup/LookupExtractor.java
 ##########
 @@ -100,12 +100,29 @@
     return map;
   }
 
+  /**
+   * Returns true if this lookup extractor's {@link #iterable()} method will 
return a valid iterator.
+   */
+  public boolean canIterate()
+  {
+    return false;
+  }
+
+  /**
+   * Returns an Iterable that iterates over the keys and values in this lookup 
extractor.
+   *
+   * @throws UnsupportedOperationException if {@link #canIterate()} returns 
false.
+   */
+  public Iterable<Map.Entry<String, String>> iterable()
+  {
+    throw new UnsupportedOperationException("Cannot iterate");
+  }
+
 
 Review comment:
   Actually, I agree. Usually the only reason I'd use default methods is if 
modifying subclasses isn't feasible (maybe it's an extension point and we don't 
want people to need to modify their existing extensions).
   
   That is the case here: LookupExtractor is an extension point.
   
   But, ah, okay, you convinced me. I'll make them abstract, which'll force 
folks with extensions to modify them.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to