jon-wei commented on a change in pull request #7133: 6088 - Time Ordering On 
Scans
URL: https://github.com/apache/incubator-druid/pull/7133#discussion_r263628213
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/scan/ScanQueryLimitRowIterator.java
 ##########
 @@ -19,35 +19,59 @@
 
 package org.apache.druid.query.scan;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import org.apache.druid.java.util.common.UOE;
 import org.apache.druid.java.util.common.guava.Sequence;
 import org.apache.druid.java.util.common.guava.Yielder;
 import org.apache.druid.java.util.common.guava.YieldingAccumulator;
 import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.druid.query.Query;
 import org.apache.druid.query.QueryPlus;
 import org.apache.druid.query.QueryRunner;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+
+/**
+ * This iterator supports iteration through a Sequence returned by a 
ScanResultValue QueryRunner.  Its behaviour
+ * varies depending on whether the query is returning time-ordered values and 
whether the CTX_KEY_OUTERMOST flag is
+ * set as false.
+ *
+ * Behaviours:
+ * 1) No time ordering: expects a Sequence of ScanResultValues which each 
contain up to query.batchSize events.
+ *    The iterator will be "done" when the limit of events is reached.  The 
final ScanResultValue might contain
+ *    fewer than batchSize events so that the limit number of events is 
returned.
+ * 2) Time Ordering, CTX_KEY_OUTERMOST==null or true: Same behaviour as no 
time ordering
+ * 3) Time Ordering, CTX_KEY_OUTERMOST=false: The Sequence returned in this 
case should contain ScanResultValues
+ *    that contain only one event each.  This iterator will perform batching 
according to query.batchSize until
+ *    the limit is reached.
+ */
 public class ScanQueryLimitRowIterator implements 
CloseableIterator<ScanResultValue>
 {
+  private static final String TIME_ORDERING_SEGMENT_ID = "No segment ID 
available when using time ordering";
 
 Review comment:
   hm, I would just make this an empty string to cut down on query result 
sizes, I think it's enough to call out the behavior in the docs

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