| <!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 --> |
| <title>CsvIO (Apache Beam 2.47.0)</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="CsvIO (Apache Beam 2.47.0)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":9,"i1":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete 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="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>Prev Class</li> |
| <li><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/beam/sdk/io/csv/CsvIO.html" target="_top">Frames</a></li> |
| <li><a href="CsvIO.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><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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.beam.sdk.io.csv</div> |
| <h2 title="Class CsvIO" class="title">Class CsvIO</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.beam.sdk.io.csv.CsvIO</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">CsvIO</span> |
| extends java.lang.Object</pre> |
| <div class="block"><a href="../../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms"><code>PTransform</code></a>s for reading and writing CSV files. |
| |
| <h2>Reading CSV files</h2> |
| |
| <p>Reading from CSV files is not yet implemented. Please see <a |
| href="https://github.com/apache/beam/issues/24552">https://github.com/apache/beam/issues/24552</a>. |
| |
| <h2>Writing CSV files</h2> |
| |
| <p>To write a <a href="../../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values"><code>PCollection</code></a> to one or more CSV files, use <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a>, using <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#writeRows-java.lang.String-org.apache.commons.csv.CSVFormat-"><code>writeRows(java.lang.String, org.apache.commons.csv.CSVFormat)</code></a> or <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#write-java.lang.String-org.apache.commons.csv.CSVFormat-"><code>write(java.lang.String, org.apache.commons.csv.CSVFormat)</code></a>. <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> supports writing <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a> or |
| custom Java types using an inferred <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a>. Examples below show both scenarios. See the |
| Beam Programming Guide on <a |
| href="https://beam.apache.org/documentation/programming-guide/#inferring-schemas">inferring |
| schemas</a> for more information on how to enable Beam to infer a <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a> from a custom |
| Java type. |
| |
| <p><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> only supports writing the parts of <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a> aware types that do not |
| contain any nested <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html" title="class in org.apache.beam.sdk.schemas"><code>Schema.FieldType</code></a>s such a <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.TypeName.html#ROW"><code>Schema.TypeName.ROW</code></a> or repeated <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.TypeName.html#ARRAY"><code>Schema.TypeName.ARRAY</code></a> types. See <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#VALID_FIELD_TYPE_SET"><code>VALID_FIELD_TYPE_SET</code></a> for valid <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html" title="class in org.apache.beam.sdk.schemas"><code>Schema.FieldType</code></a>s. |
| |
| <h3>Example usage:</h3> |
| |
| <p>Suppose we have the following <code>Transaction</code> class annotated with |
| <code>@DefaultSchema(JavaBeanSchema.class)</code> so that Beam can infer its <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a>: |
| |
| <pre><code> @DefaultSchema(JavaBeanSchema.class) |
| public class Transaction { |
| public Transaction() { … } |
| public Long getTransactionId(); |
| public void setTransactionId(Long transactionId) { … } |
| public String getBank() { … } |
| public void setBank(String bank) { … } |
| public double getPurchaseAmount() { … } |
| public void setPurchaseAmount(double purchaseAmount) { … } |
| } |
| </code></pre> |
| |
| <p>From a <code>PCollection<Transaction></code>, <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> can write one or many CSV files |
| automatically creating the header based on its inferred <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a>. |
| |
| <pre><code> |
| PCollection<Transaction> transactions = ... |
| transactions.apply(CsvIO.<Transaction>write("path/to/folder/prefix", CSVFormat.DEFAULT)); |
| </code></pre> |
| |
| <p>The resulting CSV files will look like the following where the header is repeated for every |
| file, whereas by default, <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> will write all fields in <b>sorted order</b> of the |
| field names. |
| |
| <pre><code> |
| bank,purchaseAmount,transactionId |
| A,10.23,12345 |
| B,54.65,54321 |
| C,11.76,98765 |
| </code></pre> |
| |
| <p>To control the order and subset of fields that <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> writes, use <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withHeader-java.lang.Class-" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withHeader(java.lang.Class<? extends java.lang.Enum<?>>)</code></a>. Note, however, the following constraints: |
| |
| <ol> |
| <li>Each header column must match a field name in the <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a>; matching is case |
| sensitive. |
| <li>Matching header columns must match <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a> fields that are valid <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html" title="class in org.apache.beam.sdk.schemas"><code>Schema.FieldType</code></a>s; |
| see <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#VALID_FIELD_TYPE_SET"><code>VALID_FIELD_TYPE_SET</code></a>. |
| <li><a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> only allows repeated header columns when <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withAllowDuplicateHeaderNames--" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withAllowDuplicateHeaderNames()</code></a> |
| </ol> |
| |
| <p>The following example shows the use of <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withHeader-java.lang.Class-" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withHeader(java.lang.Class<? extends java.lang.Enum<?>>)</code></a> to control the order and |
| subset of <code>Transaction</code> fields. |
| |
| <pre><code> |
| PCollection<Transaction> transactions ... |
| transactions.apply( |
| CsvIO |
| .<Transaction>write("path/to/folder/prefix", CSVFormat.DEFAULT.withHeader("transactionId", "purchaseAmount")) |
| ); |
| </code></pre> |
| |
| <p>The resulting CSV files will look like the following where the header is repeated for every |
| file, but will only include the subset of fields in their listed order. |
| |
| <pre><code> |
| transactionId,purchaseAmount |
| 12345,10.23 |
| 54321,54.65 |
| 98765,11.76 |
| </code></pre> |
| |
| <p>In addition to header customization, <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> supports <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withHeaderComments-java.lang.Object...-" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withHeaderComments(java.lang.Object...)</code></a> as shown below. Note that <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withCommentMarker-char-" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withCommentMarker(char)</code></a> is |
| required when specifying header comments. |
| |
| <pre><code> |
| PCollection<Transaction> transactions = ... |
| transactions |
| .apply( |
| CsvIO.<Transaction>write("path/to/folder/prefix", |
| CSVFormat.DEFAULT |
| .withCommentMarker('#') |
| .withHeaderComments("Bank Report", "1970-01-01", "Operator: John Doe") |
| ); |
| </code></pre> |
| |
| <p>The resulting CSV files will look like the following where the header and header comments are |
| repeated for every shard file. |
| |
| <pre><code> |
| # Bank Report |
| # 1970-01-01 |
| # Operator: John Doe |
| bank,purchaseAmount,transactionId |
| A,10.23,12345 |
| B,54.65,54321 |
| C,11.76,98765 |
| </code></pre> |
| |
| <p>A <a href="../../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values"><code>PCollection</code></a> of <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a>s works just like custom Java types illustrated above, |
| except we use <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#writeRows-java.lang.String-org.apache.commons.csv.CSVFormat-"><code>writeRows(java.lang.String, org.apache.commons.csv.CSVFormat)</code></a> as shown below for the same <code>Transaction</code> class. We |
| derive <code>Transaction</code>'s <a href="../../../../../../org/apache/beam/sdk/schemas/Schema.html" title="class in org.apache.beam.sdk.schemas"><code>Schema</code></a> using a <a href="../../../../../../org/apache/beam/sdk/schemas/annotations/DefaultSchema.DefaultSchemaProvider.html" title="class in org.apache.beam.sdk.schemas.annotations"><code>DefaultSchema.DefaultSchemaProvider</code></a>. Note that |
| hard-coding the <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a>s below is for illustration purposes. Developers are instead |
| encouraged to take advantage of <a href="../../../../../../org/apache/beam/sdk/schemas/annotations/DefaultSchema.DefaultSchemaProvider.html#toRowFunction-org.apache.beam.sdk.values.TypeDescriptor-"><code>DefaultSchema.DefaultSchemaProvider.toRowFunction(org.apache.beam.sdk.values.TypeDescriptor<T>)</code></a>. |
| |
| <pre><code> |
| DefaultSchemaProvider defaultSchemaProvider = new DefaultSchemaProvider(); |
| Schema schema = defaultSchemaProvider.schemaFor(TypeDescriptor.of(Transaction.class)); |
| PCollection<Row> transactions = pipeline.apply(Create.of( |
| Row |
| .withSchema(schema) |
| .withFieldValue("bank", "A") |
| .withFieldValue("purchaseAmount", 10.23) |
| .withFieldValue("transactionId", "12345") |
| .build(), |
| Row |
| .withSchema(schema) |
| .withFieldValue("bank", "B") |
| .withFieldValue("purchaseAmount", 54.65) |
| .withFieldValue("transactionId", "54321") |
| .build(), |
| Row |
| .withSchema(schema) |
| .withFieldValue("bank", "C") |
| .withFieldValue("purchaseAmount", 11.76) |
| .withFieldValue("transactionId", "98765") |
| .build() |
| ); |
| |
| transactions.apply( |
| CsvIO |
| .writeRowsTo("gs://bucket/path/to/folder/prefix", CSVFormat.DEFAULT) |
| ); |
| </code></pre> |
| |
| <p>Writing the transactions <a href="../../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values"><code>PCollection</code></a> of <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a>s would yield the following CSV |
| file content. |
| |
| <pre><code> |
| bank,purchaseAmount,transactionId |
| A,10.23,12345 |
| B,54.65,54321 |
| C,11.76,98765 |
| </code></pre> |
| |
| <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> does not support the following <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> properties and will throw an |
| <code>IllegalArgumentException</code>. |
| |
| <ul> |
| <li><a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withAllowMissingColumnNames--" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withAllowMissingColumnNames()</code></a> |
| <li><a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withAutoFlush-boolean-" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withAutoFlush(boolean)</code></a> |
| <li><a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withIgnoreHeaderCase--" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withIgnoreHeaderCase()</code></a> |
| <li><a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true#withIgnoreSurroundingSpaces--" title="class or interface in org.apache.commons.csv"><code>CSVFormat.withIgnoreSurroundingSpaces()</code></a> |
| </ul></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> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv">CsvIO.Write</a><<a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="type parameter in CsvIO.Write">T</a>></span></code> |
| <div class="block"><a href="../../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms"><code>PTransform</code></a> for writing CSV files.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.util.Set<<a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html" title="class in org.apache.beam.sdk.schemas">Schema.FieldType</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#VALID_FIELD_TYPE_SET">VALID_FIELD_TYPE_SET</a></span></code> |
| <div class="block">The valid <code>Schema.FieldType</code> from which <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO</code></a> converts CSV records to the fields.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#CsvIO--">CsvIO</a></span>()</code> </td> |
| </tr> |
| </table> |
| </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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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>static <T> <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv">CsvIO.Write</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#write-java.lang.String-org.apache.commons.csv.CSVFormat-">write</a></span>(java.lang.String to, |
| <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv">CSVFormat</a> csvFormat)</code> |
| <div class="block">Instantiates a <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> for writing user types in <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> format.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv">CsvIO.Write</a><<a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values">Row</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html#writeRows-java.lang.String-org.apache.commons.csv.CSVFormat-">writeRows</a></span>(java.lang.String to, |
| <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv">CSVFormat</a> csvFormat)</code> |
| <div class="block">Instantiates a <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> for writing <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a>s in <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> format.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="VALID_FIELD_TYPE_SET"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>VALID_FIELD_TYPE_SET</h4> |
| <pre>public static final java.util.Set<<a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html" title="class in org.apache.beam.sdk.schemas">Schema.FieldType</a>> VALID_FIELD_TYPE_SET</pre> |
| <div class="block">The valid <code>Schema.FieldType</code> from which <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO</code></a> converts CSV records to the fields. |
| |
| <ul> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#BYTE"><code>Schema.FieldType.BYTE</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#BOOLEAN"><code>Schema.FieldType.BOOLEAN</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#DATETIME"><code>Schema.FieldType.DATETIME</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#DECIMAL"><code>Schema.FieldType.DECIMAL</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#DOUBLE"><code>Schema.FieldType.DOUBLE</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#INT16"><code>Schema.FieldType.INT16</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#INT32"><code>Schema.FieldType.INT32</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#INT64"><code>Schema.FieldType.INT64</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#FLOAT"><code>Schema.FieldType.FLOAT</code></a> |
| <li><a href="../../../../../../org/apache/beam/sdk/schemas/Schema.FieldType.html#STRING"><code>Schema.FieldType.STRING</code></a> |
| </ul></div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="CsvIO--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>CsvIO</h4> |
| <pre>public CsvIO()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="write-java.lang.String-org.apache.commons.csv.CSVFormat-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>write</h4> |
| <pre>public static <T> <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv">CsvIO.Write</a><T> write(java.lang.String to, |
| <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv">CSVFormat</a> csvFormat)</pre> |
| <div class="block">Instantiates a <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> for writing user types in <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> format.</div> |
| </li> |
| </ul> |
| <a name="writeRows-java.lang.String-org.apache.commons.csv.CSVFormat-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>writeRows</h4> |
| <pre>public static <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv">CsvIO.Write</a><<a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values">Row</a>> writeRows(java.lang.String to, |
| <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv">CSVFormat</a> csvFormat)</pre> |
| <div class="block">Instantiates a <a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><code>CsvIO.Write</code></a> for writing <a href="../../../../../../org/apache/beam/sdk/values/Row.html" title="class in org.apache.beam.sdk.values"><code>Row</code></a>s in <a href="https://static.javadoc.io/org.apache.commons/commons-csv/1.8/org/apache/commons/csv/CSVFormat.html?is-external=true" title="class or interface in org.apache.commons.csv"><code>CSVFormat</code></a> format.</div> |
| </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="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>Prev Class</li> |
| <li><a href="../../../../../../org/apache/beam/sdk/io/csv/CsvIO.Write.html" title="class in org.apache.beam.sdk.io.csv"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/beam/sdk/io/csv/CsvIO.html" target="_top">Frames</a></li> |
| <li><a href="CsvIO.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><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |