[ 
https://issues.apache.org/jira/browse/DRILL-7442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16972341#comment-16972341
 ] 

ASF GitHub Bot commented on DRILL-7442:
---------------------------------------

vvysotskyi commented on pull request #1897: DRILL-7442: Create multi-batch row 
set reader
URL: https://github.com/apache/drill/pull/1897#discussion_r345174090
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/resultSet/ResultSetReader.java
 ##########
 @@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.physical.resultSet;
+
+import org.apache.drill.exec.physical.impl.protocol.BatchAccessor;
+import org.apache.drill.exec.physical.rowSet.RowSetReader;
+
+/**
+ * Iterates over the set of batches in a result set, providing
+ * a row set reader to iterate over the rows within each batch.
+ * Handles schema changes between batches.
+ * <h4>Protocol</h4>
+ * <ol>
+ * <li>Create an instance.</li>
+ * <li>For each incoming batch:
+ *   <ol>
+ *   <li>Call {@link #start()} to attach the batch. The provided
+ *       {@link BatchAccessor} reports if the schema has changed.</li>
+ *   <li>Call {@link #reader()} to obtain a reader.</li>
+ *   <li>Iterate over the batch using the reader.</li>
+ *   <li>Call {@link #release()} to free the memory for the
+ *       incoming batch. Or, to call {@link #detach()} to keep
+ *       the batch memory.</li>
+ *   </ol>
+ * <li>Call {@link #close()} after all batches are read.</li>
+ * </ol>
+ */
+public interface ResultSetReader {
+
+  void start(BatchAccessor batch);
 
 Review comment:
   Could you please add JavaDocs to these methods. Though their purposes are 
described in the class JavaDoc, it would be handy also to have their own ones. 
 
----------------------------------------------------------------
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:
us...@infra.apache.org


> Create multi-batch row set reader
> ---------------------------------
>
>                 Key: DRILL-7442
>                 URL: https://issues.apache.org/jira/browse/DRILL-7442
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> The "row set" work provided a {{RowSetWriter}} and {{RowSetReader}} to write 
> to and read from a single batch. The {{ResultSetLoader}} class provided a 
> writer that spans multiple batches, handling schema changes across batches 
> and so on.
> This ticket introduces a reader equivalent, the {{ResultSetReader}} that 
> reads an entire result set of multiple batches, handling schema changes along 
> the way.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to