| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>RowSetWriter (Drill : 1.20.3 API)</title> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="RowSetWriter (Drill : 1.20.3 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/RowSetWriter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSets.html" title="class in org.apache.drill.exec.physical.rowSet"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriterImpl.html" title="class in org.apache.drill.exec.physical.rowSet"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/drill/exec/physical/rowSet/RowSetWriter.html" target="_top">Frames</a></li> |
| <li><a href="RowSetWriter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.drill.exec.physical.rowSet</div> |
| <h2 title="Interface RowSetWriter" class="title">Interface RowSetWriter</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html" title="interface in org.apache.drill.exec.vector.accessor">ColumnWriter</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html" title="interface in org.apache.drill.exec.vector.accessor">TupleWriter</a></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriterImpl.html" title="class in org.apache.drill.exec.physical.rowSet">RowSetWriterImpl</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="typeNameLabel">RowSetWriter</span> |
| extends <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html" title="interface in org.apache.drill.exec.vector.accessor">TupleWriter</a></pre> |
| <div class="block">Interface for writing values to a row set. Only available |
| for newly-created, single, direct row sets. Eventually, if |
| we want to allow updating a row set, we have to create a |
| new row set with the updated columns, then merge the new |
| and old row sets to create a new immutable row set. |
| <p> |
| Typical usage: |
| <pre></code> |
| void writeABatch() { |
| RowSetWriter writer = ... |
| while (! writer.isFull()) { |
| writer.scalar(0).setInt(10); |
| writer.scalar(1).setString("foo"); |
| ... |
| writer.save(); |
| } |
| }</code></pre> |
| The above writes until the batch is full, based on size. If values |
| are large enough to potentially cause vector overflow, do the |
| following instead: |
| <pre></code> |
| void writeABatch() { |
| RowSetWriter writer = ... |
| while (! writer.isFull()) { |
| writer.column(0).setInt(10); |
| try { |
| writer.column(1).setString("foo"); |
| } catch (VectorOverflowException e) { break; } |
| ... |
| writer.save(); |
| } |
| // Do something with the partially-written last row. |
| }</code></pre> |
| <p> |
| This writer is for testing, so no provision is available to handle a |
| partial last row. (Elsewhere n Drill there are classes that handle that case.)</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.drill.exec.vector.accessor.TupleWriter"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.<a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html" title="interface in org.apache.drill.exec.vector.accessor">TupleWriter</a></h3> |
| <code><a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.UndefinedColumnException.html" title="class in org.apache.drill.exec.vector.accessor">TupleWriter.UndefinedColumnException</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSetWriter</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#addRow-java.lang.Object...-">addRow</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... values)</code> |
| <div class="block">Write a row of values, given by Java objects.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSetWriter</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#addSingleCol-java.lang.Object-">addSingleCol</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSet.SingleRowSet.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSet.SingleRowSet</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#done--">done</a></span>()</code> |
| <div class="block">Finish writing and finalize the row set being |
| written.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#isFull--">isFull</a></span>()</code> |
| <div class="block">Indicates if the current row position is valid for |
| writing.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#rowIndex--">rowIndex</a></span>()</code> </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html#save--">save</a></span>()</code> |
| <div class="block">Saves the current row and moves to the next row.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.drill.exec.vector.accessor.TupleWriter"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.drill.exec.vector.accessor.<a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html" title="interface in org.apache.drill.exec.vector.accessor">TupleWriter</a></h3> |
| <code><a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#addColumn-org.apache.drill.exec.record.metadata.ColumnMetadata-">addColumn</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#addColumn-org.apache.drill.exec.record.MaterializedField-">addColumn</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#array-int-">array</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#array-java.lang.String-">array</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#column-int-">column</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#column-java.lang.String-">column</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#dict-int-">dict</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#dict-java.lang.String-">dict</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#isProjected-java.lang.String-">isProjected</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#scalar-int-">scalar</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#scalar-java.lang.String-">scalar</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#set-int-java.lang.Object-">set</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#size--">size</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#tuple-int-">tuple</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#tuple-java.lang.String-">tuple</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#tupleSchema--">tupleSchema</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#type-int-">type</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#type-java.lang.String-">type</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#variant-int-">variant</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/TupleWriter.html#variant-java.lang.String-">variant</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.drill.exec.vector.accessor.ColumnWriter"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.drill.exec.vector.accessor.<a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html" title="interface in org.apache.drill.exec.vector.accessor">ColumnWriter</a></h3> |
| <code><a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#copy-org.apache.drill.exec.vector.accessor.ColumnReader-">copy</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#isProjected--">isProjected</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#nullable--">nullable</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#schema--">schema</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#setNull--">setNull</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#setObject-java.lang.Object-">setObject</a>, <a href="../../../../../../org/apache/drill/exec/vector/accessor/ColumnWriter.html#type--">type</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="addRow-java.lang.Object...-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addRow</h4> |
| <pre><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSetWriter</a> addRow(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... values)</pre> |
| <div class="block">Write a row of values, given by Java objects. Object type must |
| match expected column type. Stops writing, and returns false, |
| if any value causes vector overflow. Value format: |
| <ul> |
| <li>For scalars, the value as a suitable Java type (int or |
| Integer, say, for <tt>INTEGER</tt> values.)</li> |
| <li>For scalar arrays, an array of a suitable Java primitive type |
| for scalars. For example, <tt>int[]</tt> for an <tt>INTEGER</tt> |
| column.</li> |
| <li>For a Map, an <tt>Object<tt> array with values encoded as above. |
| (In fact, the list here is the same as the map format.</li> |
| <li>For a list (repeated map, list of list), an <tt>Object</tt> |
| array with values encoded as above. (So, for a repeated map, an outer |
| <tt>Object</tt> map encodes the array, an inner one encodes the |
| map members.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - variable-length argument list of column values</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="addSingleCol-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addSingleCol</h4> |
| <pre><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriter.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSetWriter</a> addSingleCol(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</pre> |
| </li> |
| </ul> |
| <a name="isFull--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isFull</h4> |
| <pre>boolean isFull()</pre> |
| <div class="block">Indicates if the current row position is valid for |
| writing. Will be false on the first row, and all subsequent |
| rows until either the maximum number of rows are written, |
| or a vector overflows. After that, will return true. The |
| method returns false as soon as any column writer overflows |
| even in the middle of a row write. That is, this writer |
| does not automatically handle overflow rows because that |
| added complexity is seldom needed for tests.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the current row can be written, false |
| if not</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="rowIndex--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>rowIndex</h4> |
| <pre>int rowIndex()</pre> |
| </li> |
| </ul> |
| <a name="save--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>save</h4> |
| <pre>void save()</pre> |
| <div class="block">Saves the current row and moves to the next row. |
| Done automatically if using <tt>setRow()</tt>.</div> |
| </li> |
| </ul> |
| <a name="done--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>done</h4> |
| <pre><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSet.SingleRowSet.html" title="interface in org.apache.drill.exec.physical.rowSet">RowSet.SingleRowSet</a> done()</pre> |
| <div class="block">Finish writing and finalize the row set being |
| written.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the completed, read-only row set without a |
| selection vector</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/RowSetWriter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSets.html" title="class in org.apache.drill.exec.physical.rowSet"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../../org/apache/drill/exec/physical/rowSet/RowSetWriterImpl.html" title="class in org.apache.drill.exec.physical.rowSet"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/drill/exec/physical/rowSet/RowSetWriter.html" target="_top">Frames</a></li> |
| <li><a href="RowSetWriter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 1970 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |