You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2017/01/25 15:04:47 UTC

[GitHub] spark pull request #16703: [SPARK-12970][DOCS] Fix the example in SturctType...

GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/16703

    [SPARK-12970][DOCS] Fix the example in SturctType APIs for Scala and Java

    ## What changes were proposed in this pull request?
    
    This PR fixes both,
    
    javadoc8 break 
    
    ```
    [error] .../spark/sql/hive/target/java/org/apache/spark/sql/hive/FindHiveSerdeTable.java:3: error: reference not found
    [error]  * Replaces {@link SimpleCatalogRelation} with {@link MetastoreRelation} if its table provider is hive.
    ```
    
    and the example in `StructType` as a self-contained example as below:
    
    ```scala
    import org.apache.spark.sql._
    import org.apache.spark.sql.types._
    
    val struct =
      StructType(
        StructField("a", IntegerType, true) ::
        StructField("b", LongType, false) ::
        StructField("c", BooleanType, false) :: Nil)
    
    // Extract a single StructField.
    val singleField = struct("b")
    // singleField: StructField = StructField(b,LongType,false)
    
    // If this struct does not have a field called "d", it throws an exception.
    struct("d")
    // java.lang.IllegalArgumentException: Field "d" does not exist.
    //   ...
    
    // Extract multiple StructFields. Field names are provided in a set.
    // A StructType object will be returned.
    val twoFields = struct(Set("b", "c"))
    // twoFields: StructType =
    //   StructType(StructField(b,LongType,false), StructField(c,BooleanType,false))
    
    // Any names without matching fields will be ignored.
    // For the case shown below, "d" will be ignored and
    // it is treated as struct(Set("b", "c")).
    struct(Set("b", "c", "d"))
    // java.lang.IllegalArgumentException: Field "d" does not exist.
    //    ...
    ```
    
    ```scala
    import org.apache.spark.sql._
    import org.apache.spark.sql.types._
    
    val innerStruct =
      StructType(
        StructField("f1", IntegerType, true) ::
        StructField("f2", LongType, false) ::
        StructField("f3", BooleanType, false) :: Nil)
    
    val struct = StructType(
      StructField("a", innerStruct, true) :: Nil)
     
     // Create a Row with the schema defined by struct
     val row = Row(Row(1, 2, true))
    ```
    
    Also, now when the column is missing, it throws an exception rather than ignoring.
    
    
    ## How was this patch tested?
    
    Manually via `sbt unidoc`.
    
    - Scaladoc
    
      <img width="658" alt="2017-01-26 12 02 46" src="https://cloud.githubusercontent.com/assets/6477701/22295599/d417a3cc-e35a-11e6-8533-7d904640c834.png">
    
      <img width="444" alt="2017-01-25 11 48 09" src="https://cloud.githubusercontent.com/assets/6477701/22295140/314e1eb0-e359-11e6-943c-c11c26087113.png">
    
    - Javadoc
    
      <img width="713" alt="2017-01-26 12 02 38" src="https://cloud.githubusercontent.com/assets/6477701/22295605/deea817a-e35a-11e6-93c5-48a9029024cc.png">
    
    
      <img width="444" alt="2017-01-25 11 47 58" src="https://cloud.githubusercontent.com/assets/6477701/22295169/4eb4a140-e359-11e6-82c0-690519c9f4b9.png">

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/spark SPARK-12970

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/16703.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16703
    
----
commit 2e9bec8c8b3676967ae6b292bfa1c2396416b15e
Author: hyukjinkwon <gu...@gmail.com>
Date:   2017-01-25T14:37:45Z

    Fix the example in SturctType APIs for Scala and Java

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71991 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71991/testReport)** for PR 16703 at commit [`b9a841d`](https://github.com/apache/spark/commit/b9a841d56152dff8c33ad0aa89d85b1e0fc2ad5d).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71992 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71992/testReport)** for PR 16703 at commit [`f6a1059`](https://github.com/apache/spark/commit/f6a1059efa838171c5bc9506f1657f49481f3949).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71991 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71991/testReport)** for PR 16703 at commit [`b9a841d`](https://github.com/apache/spark/commit/b9a841d56152dff8c33ad0aa89d85b1e0fc2ad5d).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71990 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71990/testReport)** for PR 16703 at commit [`2e9bec8`](https://github.com/apache/spark/commit/2e9bec8c8b3676967ae6b292bfa1c2396416b15e).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71992/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #16703: [SPARK-12970][DOCS] Fix the example in SturctType...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/16703


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71990 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71990/testReport)** for PR 16703 at commit [`2e9bec8`](https://github.com/apache/spark/commit/2e9bec8c8b3676967ae6b292bfa1c2396416b15e).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    (I just added some links for `StructType` and `StructField` around this examples just for consistency and while I was here)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Merged to master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    **[Test build #71992 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71992/testReport)** for PR 16703 at commit [`f6a1059`](https://github.com/apache/spark/commit/f6a1059efa838171c5bc9506f1657f49481f3949).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    cc @srowen and @joshrosen who are in the JIRA.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71991/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16703: [SPARK-12970][DOCS] Fix the example in SturctType APIs f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16703
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71990/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org