beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ming...@apache.org
Subject [39/66] [abbrv] beam git commit: [BEAM-2733] update javadoc for BeamSql
Date Mon, 11 Sep 2017 20:19:22 GMT
[BEAM-2733] update javadoc for BeamSql


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/214c7918
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/214c7918
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/214c7918

Branch: refs/heads/master
Commit: 214c791861178ba00ff4396367c95e8a0e85fdfd
Parents: cddf9d9
Author: James Xu <xumingmingv@gmail.com>
Authored: Tue Aug 8 19:52:53 2017 +0800
Committer: mingmxu <mingmxu@ebay.com>
Committed: Mon Sep 11 10:56:56 2017 -0700

----------------------------------------------------------------------
 .../org/apache/beam/sdk/extensions/sql/BeamSql.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/214c7918/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/BeamSql.java
----------------------------------------------------------------------
diff --git a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/BeamSql.java
b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/BeamSql.java
index 86e4d8d..d0a6360 100644
--- a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/BeamSql.java
+++ b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/BeamSql.java
@@ -71,6 +71,7 @@ outputTableB.apply(...).apply(TextIO.write().to("/my/output/path"));
 p.run().waitUntilFinish();
  * }
  * </pre>
+ *
  */
 @Experimental
 public class BeamSql {
@@ -82,8 +83,14 @@ public class BeamSql {
    * table. The {@link PCollectionTuple} contains the mapping from {@code table names} to
    * {@code PCollection<BeamSqlRow>}, each representing an input table.
    *
-   * <p>It is an error to apply a {@link PCollectionTuple} missing any {@code table
names}
-   * referenced within the query.
+   * <ul>
+   * <li>If the sql query only uses a subset of tables from the upstream {@link PCollectionTuple},
+   *     this is valid;</li>
+   * <li>If the sql query references a table not included in the upstream {@link PCollectionTuple},
+   *     an {@code IllegalStateException} is thrown during query validation;</li>
+   * <li>Always, tables from the upstream {@link PCollectionTuple} are only valid in
the scope
+   *     of the current query call.</li>
+   * </ul>
    */
   public static QueryTransform query(String sqlQuery) {
     return QueryTransform.builder()
@@ -100,7 +107,7 @@ public class BeamSql {
    *
    * <p>Make sure to query it from a static table name <em>PCOLLECTION</em>.
    */
-  public static SimpleQueryTransform simpleQuery(String sqlQuery) throws Exception {
+  public static SimpleQueryTransform simpleQuery(String sqlQuery) {
     return SimpleQueryTransform.builder()
         .setSqlEnv(new BeamSqlEnv())
         .setSqlQuery(sqlQuery)
@@ -109,6 +116,9 @@ public class BeamSql {
 
   /**
    * A {@link PTransform} representing an execution plan for a SQL query.
+   *
+   * <p>The table names in the input {@code PCollectionTuple} are only valid during
the current
+   * query.
    */
   @AutoValue
   public abstract static class QueryTransform extends


Mime
View raw message