This is an automated email from the ASF dual-hosted git repository. mergebot-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/beam-site.git
commit e568ceabc4cf5f1dda5d6cc1b0655e74048e92a2 Author: Mergebot <[email protected]> AuthorDate: Fri Aug 3 14:23:13 2018 +0000 Prepare repository for deployment. --- .../io/built-in/{ => hcatalog}/index.html | 288 +++++++++++---------- content/documentation/io/built-in/index.html | 2 +- 2 files changed, 148 insertions(+), 142 deletions(-) diff --git a/content/documentation/io/built-in/index.html b/content/documentation/io/built-in/hcatalog/index.html similarity index 63% copy from content/documentation/io/built-in/index.html copy to content/documentation/io/built-in/hcatalog/index.html index 1ae8922..69f36af 100644 --- a/content/documentation/io/built-in/index.html +++ b/content/documentation/io/built-in/hcatalog/index.html @@ -28,7 +28,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Built-in I/O Transforms</title> + <title>Apache HCatalog InputFormat IO</title> <meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...] "> <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet"> @@ -39,7 +39,7 @@ <script src="/js/fix-menu.js"></script> <script src="/js/section-nav.js"></script> <script src="/js/page-nav.js"></script> - <link rel="canonical" href="https://beam.apache.org/documentation/io/built-in/" data-proofer-ignore> + <link rel="canonical" href="https://beam.apache.org/documentation/io/built-in/hcatalog/" data-proofer-ignore> <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico"> <link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml"> <script> @@ -251,150 +251,156 @@ +<ul class="nav"> + <li><a href="#reading-using-hcatalogio">Reading using HCatalogIO</a></li> + <li><a href="#writing-using-hcatalogio">Writing using HCatalogIO</a></li> + <li><a href="#using-older-versions-of-hcatalog-1x">Using older versions of HCatalog (1.x)</a></li> +</ul> </nav> <div class="body__contained body__section-nav"> - <!-- -Licensed 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. ---> - -<p><a href="/documentation/io/io-toc/">Pipeline I/O Table of Contents</a></p> - -<h1 id="built-in-io-transforms">Built-in I/O Transforms</h1> - -<p>This table contains the currently available I/O transforms.</p> - -<p>Consult the <a href="/documentation/programming-guide#pipeline-io">Programming Guide I/O section</a> for general usage instructions, and see the javadoc/pydoc for the particular I/O transforms.</p> - -<table class="table table-bordered"> -<tr> - <th>Language</th> - <th>File-based</th> - <th>Messaging</th> - <th>Database</th> -</tr> -<tr> - <td>Java</td> - <td> - <p>Beam Java supports Apache HDFS, Amazon S3, Google Cloud Storage, and local filesystems.</p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileIO.java">FileIO</a> (general-purpose reading, writing, and matching of files)</p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/AvroIO.java">AvroIO</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/TextIO.java">TextIO</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/TFRecordIO.java">TFRecordIO</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/io/xml/src/main/java/org/apache/beam/sdk/io/xml/XmlIO.java">XmlIO</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/io/tika/src/main/java/org/apache/beam/sdk/io/tika/TikaIO.java">TikaIO</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java">ParquetIO</a></p> - </td> - <td> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/kinesis">Amazon Kinesis</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/amqp">AMQP</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/kafka">Apache Kafka</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub">Google Cloud Pub/Sub</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/jms">JMS</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/mqtt">MQTT</a></p> - </td> - <td> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/cassandra">Apache Cassandra</a></p> - <p><a href="/documentation/io/built-in/hadoop/">Apache Hadoop InputFormat</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/hbase">Apache HBase</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/hcatalog">Apache Hive (HCatalog)</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/kudu">Apache Kudu</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/solr">Apache Solr</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/elasticsearch">Elasticsearch (v2.x and v5.x)</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery">Google BigQuery</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable">Google Cloud Bigtable</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore">Google Cloud Datastore</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner">Google Cloud Spanner</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/jdbc">JDBC</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/mongodb">MongoDB</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/redis">Redis</a></p> - </td> -</tr> -<tr> - <td>Python</td> - <td> - <p>Beam Python supports Google Cloud Storage and local filesystems.</p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/avroio.py">avroio</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/textio.py">textio</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/tfrecordio.py">tfrecordio</a></p> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/vcfio.py">vcfio</a></p> - </td> - <td> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/pubsub.py">Google Cloud Pub/Sub</a></p> - </td> - <td> - <p><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery.py">Google BigQuery</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/python/apache_beam/io/gcp/datastore">Google Cloud Datastore</a></p> - </td> - -</tr> -</table> - -<h1 id="in-progress-io-transforms">In-Progress I/O Transforms</h1> - -<p>This table contains I/O transforms that are currently planned or in-progress. Status information can be found on the JIRA issue, or on the GitHub PR linked to by the JIRA issue (if there is one).</p> - -<table class="table table-bordered"> - <tr> - <th>Name</th><th>Language</th><th>JIRA</th> - </tr> - <tr> - <td>Apache HDFS support</td><td>Python</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-3099">BEAM-3099</a></td> - </tr> - <tr> - <td>Apache DistributedLog</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-607">BEAM-607</a></td> - </tr> - <tr> - <td>Apache Kafka</td><td>Python</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-3788">BEAM-3788</a></td> - </tr> - <tr> - <td>Apache Sqoop</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-67">BEAM-67</a></td> - </tr> - <tr> - <td>Couchbase</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-1893">BEAM-1893</a></td> - </tr> - <tr> - <td>InfluxDB</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-2546">BEAM-2546</a></td> - </tr> - <tr> - <td>Memcached</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-1678">BEAM-1678</a></td> - </tr> - <tr> - <td>Neo4j</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-1857">BEAM-1857</a></td> - </tr> - <tr> - <td>RabbitMQ</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-1240">BEAM-1240</a></td> - </tr> - <tr> - <td>RestIO</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-1946">BEAM-1946</a></td> - </tr> - <tr> - <td>Amazon SQS</td><td>Java</td> - <td><a href="https://issues.apache.org/jira/browse/BEAM-4828">BEAM-4828</a></td> - </tr> -</table> + <p><a href="/documentation/io/io-toc/">Pipeline I/O Table of Contents</a></p> + +<h1 id="hcatalog-io">HCatalog IO</h1> + +<p>An <code class="highlighter-rouge">HCatalogIO</code> is a transform for reading and writing data to an HCatalog managed source.</p> + +<h3 id="reading-using-hcatalogio">Reading using HCatalogIO</h3> + +<p>To configure an HCatalog source, you must specify a metastore URI and a table name. Other optional parameters are database and filter.</p> + +<p>For example:</p> +<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">Map</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">></span> <span class="n">configProperties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">>() [...] +<span class="n">configProperties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"hive.metastore.uris"</span><span class="o">,</span><span class="s">"thrift://metastore-host:port"</span><span class="o">);</span> +<span class="n">pipeline</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">HCatalogIO</span><span class="o">.</span><span class="na">read</span><span class="o">()</span> + <span class="o">.</span><span class="na">withConfigProperties</span><span class="o">(</span><span class="n">configProperties</span><span class="o">)</span> + <span class="o">.</span><span class="na">withDatabase</span><span class="o">(</span><span class="s">"default"</span><span class="o">)</span> <span class="c1">//optional, assumes default if none specified</span> + <span class="o">.</span><span class="na">withTable</span><span class="o">(</span><span class="s">"employee"</span><span class="o">)</span> + <span class="o">.</span><span class="na">withFilter</span><span class="o">(</span><span class="n">filterString</span><span class="o">)</span> <span class="c1">//optional, may be specified if the table is partitioned</span> +</code></pre> +</div> +<div class="language-py highlighter-rouge"><pre class="highlight"><code> <span class="c"># The Beam SDK for Python does not support HCatalogIO.</span> +</code></pre> +</div> + +<h3 id="writing-using-hcatalogio">Writing using HCatalogIO</h3> + +<p>To configure an <code class="highlighter-rouge">HCatalog</code> sink, you must specify a metastore URI and a table name. Other +optional parameters are database, partition and batchsize. +The destination table should exist beforehand as the transform will not create a new table if missing.</p> + +<p>For example:</p> +<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">Map</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">></span> <span class="n">configProperties</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">>() [...] +<span class="n">configProperties</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"hive.metastore.uris"</span><span class="o">,</span><span class="s">"thrift://metastore-host:port"</span><span class="o">);</span> + +<span class="n">pipeline</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(...)</span> + <span class="o">.</span><span class="na">apply</span><span class="o">(</span><span class="n">HCatalogIO</span><span class="o">.</span><span class="na">write</span><span class="o">()</span> + <span class="o">.</span><span class="na">withConfigProperties</span><span class="o">(</span><span class="n">configProperties</span><span class="o">)</span> + <span class="o">.</span><span class="na">withDatabase</span><span class="o">(</span><span class="s">"default"</span><span class="o">)</span> <span class="c1">//optional, assumes default if none specified</span> + <span class="o">.</span><span class="na">withTable</span><span class="o">(</span><span class="s">"employee"</span><span class="o">)</span> + <span class="o">.</span><span class="na">withPartition</span><span class="o">(</span><span class="n">partitionValues</span><span class="o">)</span> <span class="c1">//optional, may be specified if the table is partitioned</span> + <span class="o">.</span><span class="na">withBatchSize</span><span class="o">(</span><span class="mi">1024L</span><span class="o">))</span> <span class="c1">//optional, assumes a default batch size of 1024 if none specified</span> +</code></pre> +</div> +<div class="language-py highlighter-rouge"><pre class="highlight"><code> <span class="c"># The Beam SDK for Python does not support HCatalogIO.</span> +</code></pre> +</div> + +<h3 id="using-older-versions-of-hcatalog-1x">Using older versions of HCatalog (1.x)</h3> + +<p><code class="highlighter-rouge">HCatalogIO</code> is build for Apache HCatalog versions 2 and up and will not work out of the box for older versions of HCatalog. +The following illustrates a workaround to work with Hive 1.1.</p> + +<p>Include the following Hive 1.2 jars in the über jar you build. +The 1.2 jars provide the necessary methods for Beam while remain compatible with Hive 1.1.</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><dependency> + <groupId>org.apache.beam</groupId> + <artifactId>beam-sdks-java-io-hcatalog</artifactId> + <version>${beam.version}</version> +</dependency> +<dependency> + <groupId>org.apache.hive.hcatalog</groupId> + <artifactId>hive-hcatalog-core</artifactId> + <version>1.2</version> +</dependency> +<dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-metastore</artifactId> + <version>1.2</version> +</dependency> +<dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-exec</artifactId> + <version>1.2</version> +</dependency> +<dependency> + <groupId>org.apache.hive</groupId> + <artifactId>hive-common</artifactId> + <version>1.2</version> +</dependency> +</code></pre> +</div> + +<p>Relocate <em>only</em> the following hive packages:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>${maven-shade-plugin.version}</version> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadedArtifactAttached>true</shadedArtifactAttached> + <shadedClassifierName>shaded</shadedClassifierName> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + </transformers> + <relocations> + <!-- Important: Do not relocate org.apache.hadoop.hive --> + <relocation> + <pattern>org.apache.hadoop.hive.conf</pattern> + <shadedPattern>h12.org.apache.hadoop.hive.conf</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.hadoop.hive.ql</pattern> + <shadedPattern>h12.org.apache.hadoop.hive.ql</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.hadoop.hive.metastore</pattern> + <shadedPattern>h12.org.apache.hadoop.hive.metastore</shadedPattern> + </relocation> + </relocations> + </configuration> + </execution> + </executions> +</plugin> +</code></pre> +</div> + +<p>This has been testing to read SequenceFile and ORCFile file backed tables running with +Beam 2.4.0 on Spark 2.3 / YARN in a Cloudera CDH 5.12.2 managed environment.</p> </div> </div> diff --git a/content/documentation/io/built-in/index.html b/content/documentation/io/built-in/index.html index 1ae8922..c794422 100644 --- a/content/documentation/io/built-in/index.html +++ b/content/documentation/io/built-in/index.html @@ -309,7 +309,7 @@ limitations under the License. <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/cassandra">Apache Cassandra</a></p> <p><a href="/documentation/io/built-in/hadoop/">Apache Hadoop InputFormat</a></p> <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/hbase">Apache HBase</a></p> - <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/hcatalog">Apache Hive (HCatalog)</a></p> + <p><a href="/documentation/io/built-in/hcatalog">Apache Hive (HCatalog)</a></p> <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/kudu">Apache Kudu</a></p> <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/solr">Apache Solr</a></p> <p><a href="https://github.com/apache/beam/tree/master/sdks/java/io/elasticsearch">Elasticsearch (v2.x and v5.x)</a></p>
