You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by wangmiao1981 <gi...@git.apache.org> on 2016/07/07 23:29:20 UTC

[GitHub] spark pull request #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

GitHub user wangmiao1981 opened a pull request:

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

    [SPARK-16380][SQL][Example]:Update SQL examples and programming guide for Python language binding

    ## What changes were proposed in this pull request?
    
    (Please fill in changes proposed in this fix)
    In current sql-programming-guide.md, Python examples are hard coded in the md file.
    
    I update the file by adding a separate SparkSQLExample.py as ml examples.
    
    In this file, I included all working and hard-coded examples as a self-contained application, except for Hive examples. For example, spark.refershtable, which doesn't exist in SparkSession. We can revisit these examples and put it in the self-contained application.
    
    ## How was this patch tested?
    
    (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
    Manual tests:
    ./bin/spark-submit examples/src/main/python/SparkSQLExample.py
    Build docs and check generated document including correct examples as ml document.
    


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

    $ git pull https://github.com/wangmiao1981/spark sql

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

    https://github.com/apache/spark/pull/14098.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 #14098
    
----

----


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62413/
    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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62649/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61940/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #61940 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61940/consoleFull)** for PR 14098 at commit [`d92d933`](https://github.com/apache/spark/commit/d92d933937571b65670a2a308c936c0d9061b382).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Yea, especially on case insensitive OS'es like Mac and Windows, the doc actually builds successfully even when cases of the example file names don't match. I guess that's probably why we missed SPARK-16553.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14098#discussion_r70588560
  
    --- Diff: examples/src/main/python/SparkSQLExample.py ---
    @@ -0,0 +1,208 @@
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You 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.
    +#
    +
    +from __future__ import print_function
    +
    +# $example on:init_session$
    +from pyspark.sql import SparkSession
    +# $example off:init_session$
    +
    +# $example on:schema_infer$
    +# spark is an existing SparkSession.
    +from pyspark.sql import Row
    +# $example off:schema_infer$
    +
    +# $example on:schema_spec$
    +# Import SparkSession and data types
    +from pyspark.sql.types import *
    +# $example off:schema_spec$
    +
    +"""
    +A simple example demonstrating Spark SQL.
    +Run with:
    +  ./bin/spark-submit examples/src/main/python/SparkSQLExample.py
    +"""
    +
    +if __name__ == "__main__":
    +    # $example on:init_session$
    +    spark = SparkSession\
    +        .builder\
    +        .appName("PythonSQL")\
    +        .config("spark.some.config.option", "some-value")\
    +        .getOrCreate()
    --- End diff --
    
    Nit: Please use 2-space indentation 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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62651 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62651/consoleFull)** for PR 14098 at commit [`8563ecb`](https://github.com/apache/spark/commit/8563ecb7d980cde7ccb515ed2e75da929d233568).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62405 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62405/consoleFull)** for PR 14098 at commit [`8ed04fa`](https://github.com/apache/spark/commit/8ed04fae588be39bd4e1a7f082c13b104db1fe21).


---
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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    @liancheng Sorry for replying late. I was on vacation last a few days.
    
    I have addressed most of your comments. Only the .md file is not updated yet. 
    
    By the way, I am trying to make the hive example work, but I still can not get it work. Any suggestions? I found that pyspark sql is different from the corresponding scala hive example.
    
    Thanks!
    
    Miao


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    As #14317 has been merged, I close this PR.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62405 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62405/consoleFull)** for PR 14098 at commit [`8ed04fa`](https://github.com/apache/spark/commit/8ed04fae588be39bd4e1a7f082c13b104db1fe21).
     * This patch **fails Python style 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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62649 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62649/consoleFull)** for PR 14098 at commit [`95b16f5`](https://github.com/apache/spark/commit/95b16f5bba48455af738a364861cba7ba56a791a).
     * 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @wangmiao1981 I guess it's not ready yet. You may put a `[WIP]` tag in the PR title when it's in WIP status and remove it when it is ready for review.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #61939 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61939/consoleFull)** for PR 14098 at commit [`94df090`](https://github.com/apache/spark/commit/94df0908d17d28eb6c0223456df7daad24899e47).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #61939 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61939/consoleFull)** for PR 14098 at commit [`94df090`](https://github.com/apache/spark/commit/94df0908d17d28eb6c0223456df7daad24899e47).
     * This patch **fails Python style 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

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


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Merged build finished. Test FAILed.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62413 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62413/consoleFull)** for PR 14098 at commit [`8d94dd3`](https://github.com/apache/spark/commit/8d94dd39fa6a3da3089f4474c136269910c72ff2).
     * 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #61940 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61940/consoleFull)** for PR 14098 at commit [`d92d933`](https://github.com/apache/spark/commit/d92d933937571b65670a2a308c936c0d9061b382).
     * 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @liancheng Can you review it? Thanks!


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14098#discussion_r71103044
  
    --- Diff: docs/sql-programming-guide.md ---
    @@ -79,7 +79,7 @@ The entry point into all functionality in Spark is the [`SparkSession`](api/java
     
     The entry point into all functionality in Spark is the [`SparkSession`](api/python/pyspark.sql.html#pyspark.sql.SparkSession) class. To create a basic `SparkSession`, just use `SparkSession.builder`:
     
    -{% include_example init_session python/sql.py %}
    +{% include_example init_session python/SparkSQLExample.py %}
    --- End diff --
    
    The original file name `sql.py` should be fine. Actually, the new name `SparkSQLExample.py` doesn't conform to Python convention. (You may check other file names under `examples/src/main/python`.)


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62651/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62416 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62416/consoleFull)** for PR 14098 at commit [`68e65fa`](https://github.com/apache/spark/commit/68e65fa5675eed0359e7d8c36020cabc9b2cea47).
     * 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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @wangmiao1981 Thanks for working on this. For the Hive example, I guess you probably forgot to call `enableHiveSupport()` over the `SparkSession` object. And I made a mistake about the indentation, 4-space indentation is OK for Python. Sorry for the trouble...
    
    I just opened PR #14317 based on your work. Sorry that I didn't realize that you finished working on this PR before sending #14317. However, that one also addressed more minor styling issues and added a separate Hive example file. Would you mind to help review it? I will attribute this work to you in #14317.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Not completed. Please hold on for review. 


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14098#discussion_r71103329
  
    --- Diff: docs/sql-programming-guide.md ---
    @@ -79,7 +79,7 @@ The entry point into all functionality in Spark is the [`SparkSession`](api/java
     
     The entry point into all functionality in Spark is the [`SparkSession`](api/python/pyspark.sql.html#pyspark.sql.SparkSession) class. To create a basic `SparkSession`, just use `SparkSession.builder`:
     
    -{% include_example init_session python/sql.py %}
    +{% include_example init_session python/SparkSQLExample.py %}
    --- End diff --
    
    And the file path is wrong. The actual path is `python/sql/SparkSqlExample.py`.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62416 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62416/consoleFull)** for PR 14098 at commit [`68e65fa`](https://github.com/apache/spark/commit/68e65fa5675eed0359e7d8c36020cabc9b2cea47).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62416/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    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 pull request #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14098#discussion_r70588517
  
    --- Diff: examples/src/main/python/SparkSQLExample.py ---
    @@ -0,0 +1,208 @@
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You 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.
    +#
    +
    +from __future__ import print_function
    +
    +# $example on:init_session$
    +from pyspark.sql import SparkSession
    +# $example off:init_session$
    +
    +# $example on:schema_infer$
    +# spark is an existing SparkSession.
    +from pyspark.sql import Row
    +# $example off:schema_infer$
    +
    +# $example on:schema_spec$
    +# Import SparkSession and data types
    +from pyspark.sql.types import *
    +# $example off:schema_spec$
    +
    +"""
    +A simple example demonstrating Spark SQL.
    +Run with:
    +  ./bin/spark-submit examples/src/main/python/SparkSQLExample.py
    +"""
    +
    +if __name__ == "__main__":
    +    # $example on:init_session$
    +    spark = SparkSession\
    +        .builder\
    +        .appName("PythonSQL")\
    +        .config("spark.some.config.option", "some-value")\
    +        .getOrCreate()
    +    # $example off:init_session$
    +
    +    # $example on:create_df$
    +    # spark is an existing SparkSession
    +    df = spark.read.json("examples/src/main/resources/people.json")
    +
    +    # Displays the content of the DataFrame to stdout
    +    df.show()
    +    # age  name
    +    # null Michael
    +    # 30   Andy
    +    # 19   Justin
    +    # $example off:create_df$
    +
    +    # $example on:untyped_ops$
    +    # spark, df are from the previous example
    +    # Print the schema in a tree format
    +    df.printSchema()
    +    # root
    +    # |-- age: long (nullable = true)
    +    # |-- name: string (nullable = true)
    +
    +    # Select only the "name" column
    +    df.select("name").show()
    +    # name
    +    # Michael
    +    # Andy
    +    # Justin
    +
    +    # Select everybody, but increment the age by 1
    +    df.select(df['name'], df['age'] + 1).show()
    --- End diff --
    
    cc @JoshRosen @davies


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @liancheng I addressed all your comments. Except: 1). 2-spaces indents; I tried it, but it failed on python style tests. So I leave it 4-spaces indents; 2) `col('...')` I haven't changed it yet. Do you have a finial decision on this part? 
    
    It is ready to review now.
    
    Thanks!


---
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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @liancheng Thanks for your review! I will address your comments asap. Currently, I am working on a ML wrapper for R. 


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62413 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62413/consoleFull)** for PR 14098 at commit [`8d94dd3`](https://github.com/apache/spark/commit/8d94dd39fa6a3da3089f4474c136269910c72ff2).


---
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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62648 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62648/consoleFull)** for PR 14098 at commit [`ac47d8d`](https://github.com/apache/spark/commit/ac47d8d4ba2e80b4e5fdac9f586a7ccf583fab90).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @liancheng Thanks! I will review the PR #14317 


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62651 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62651/consoleFull)** for PR 14098 at commit [`8563ecb`](https://github.com/apache/spark/commit/8563ecb7d980cde7ccb515ed2e75da929d233568).
     * 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Please be careful with case sensitivity. It broke the release candidate last time.



---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    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 pull request #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

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

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


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Thanks for doing this! Overall it's pretty nice. A few high level comments:
    
    1. It might be better to split the whole example file into several methods, as what #14119 did. In this way, the code can be easier to follow, and we can avoid using variable names like `df1`, `df2`, and `df3`.
    2. Could you please add actual output after each `.show()` call? I think you can simply copy them from #14119.
    3. Could you please update example snippet label names to match those used in #14119?



---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Merged build finished. Test FAILed.


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62415/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62649 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62649/consoleFull)** for PR 14098 at commit [`95b16f5`](https://github.com/apache/spark/commit/95b16f5bba48455af738a364861cba7ba56a791a).


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

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


---
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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62415 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62415/consoleFull)** for PR 14098 at commit [`91a2e10`](https://github.com/apache/spark/commit/91a2e1067b24df48f25bb540248d27bd9cc57f9c).
     * 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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    @wangmiao1981 Is this ready for review now? Also, please update the PR title to:
    
    ```
    [SPARK-16380][SQL][EXAMPLE] Update SQL examples and programming guide for Python language binding
    ```


---
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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62648 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62648/consoleFull)** for PR 14098 at commit [`ac47d8d`](https://github.com/apache/spark/commit/ac47d8d4ba2e80b4e5fdac9f586a7ccf583fab90).
     * 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 pull request #14098: [SPARK-16380][SQL][Example]:Update SQL examples a...

Posted by liancheng <gi...@git.apache.org>.
Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14098#discussion_r70588473
  
    --- Diff: examples/src/main/python/SparkSQLExample.py ---
    @@ -0,0 +1,208 @@
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You 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.
    +#
    +
    +from __future__ import print_function
    +
    +# $example on:init_session$
    +from pyspark.sql import SparkSession
    +# $example off:init_session$
    +
    +# $example on:schema_infer$
    +# spark is an existing SparkSession.
    +from pyspark.sql import Row
    +# $example off:schema_infer$
    +
    +# $example on:schema_spec$
    +# Import SparkSession and data types
    +from pyspark.sql.types import *
    +# $example off:schema_spec$
    +
    +"""
    +A simple example demonstrating Spark SQL.
    +Run with:
    +  ./bin/spark-submit examples/src/main/python/SparkSQLExample.py
    +"""
    +
    +if __name__ == "__main__":
    +    # $example on:init_session$
    +    spark = SparkSession\
    +        .builder\
    +        .appName("PythonSQL")\
    +        .config("spark.some.config.option", "some-value")\
    +        .getOrCreate()
    +    # $example off:init_session$
    +
    +    # $example on:create_df$
    +    # spark is an existing SparkSession
    +    df = spark.read.json("examples/src/main/resources/people.json")
    +
    +    # Displays the content of the DataFrame to stdout
    +    df.show()
    +    # age  name
    +    # null Michael
    +    # 30   Andy
    +    # 19   Justin
    +    # $example off:create_df$
    +
    +    # $example on:untyped_ops$
    +    # spark, df are from the previous example
    +    # Print the schema in a tree format
    +    df.printSchema()
    +    # root
    +    # |-- age: long (nullable = true)
    +    # |-- name: string (nullable = true)
    +
    +    # Select only the "name" column
    +    df.select("name").show()
    +    # name
    +    # Michael
    +    # Andy
    +    # Justin
    +
    +    # Select everybody, but increment the age by 1
    +    df.select(df['name'], df['age'] + 1).show()
    --- End diff --
    
    @rxin @cloud-fan Shall we deprecate, or at least not recommend, using `df['...']` to reference columns since this may lead to potential ambiguity in self-join cases? I'm thinking about replacing it with `col('...')` in all Python example code.


---
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 #14098: [WIP][SPARK-16380][SQL][Example]:Update SQL examples and...

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

    https://github.com/apache/spark/pull/14098
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/62648/
    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 #14098: [SPARK-16380][SQL][Example]:Update SQL examples and prog...

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

    https://github.com/apache/spark/pull/14098
  
    **[Test build #62415 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62415/consoleFull)** for PR 14098 at commit [`91a2e10`](https://github.com/apache/spark/commit/91a2e1067b24df48f25bb540248d27bd9cc57f9c).


---
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