You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2020/10/18 07:54:59 UTC

[spark] branch branch-2.4 updated: [MINOR][DOCS][EXAMPLE] Fix the Python manual_load_options_csv example

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 4ebe947  [MINOR][DOCS][EXAMPLE] Fix the Python manual_load_options_csv example
4ebe947 is described below

commit 4ebe947c36ac24ac420e0ff39ce360ef6d8c0309
Author: Keiji Yoshida <kj...@gmail.com>
AuthorDate: Sun Oct 18 16:47:04 2020 +0900

    [MINOR][DOCS][EXAMPLE] Fix the Python manual_load_options_csv example
    
    ### What changes were proposed in this pull request?
    This pull request changes the `sep` parameter's value from `:` to `;` in the example of `examples/src/main/python/sql/datasource.py`. This code snippet is shown on the Spark SQL Guide documentation. The `sep` parameter's value should be `;` since the data in https://github.com/apache/spark/blob/master/examples/src/main/resources/people.csv is separated by `;`.
    
    ### Why are the changes needed?
    To fix the example code so that it can be executed properly.
    
    ### Does this PR introduce _any_ user-facing change?
    Yes.
    This code snippet is shown on the Spark SQL Guide documentation: https://spark.apache.org/docs/latest/sql-data-sources-load-save-functions.html#manually-specifying-options
    
    ### How was this patch tested?
    By building the documentation and checking the Spark SQL Guide documentation manually in the local environment.
    
    Closes #30082 from kjmrknsn/fix-example-python-datasource.
    
    Authored-by: Keiji Yoshida <kj...@gmail.com>
    Signed-off-by: HyukjinKwon <gu...@apache.org>
---
 examples/src/main/python/sql/datasource.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/src/main/python/sql/datasource.py b/examples/src/main/python/sql/datasource.py
index 888e92a..80c4fcb 100644
--- a/examples/src/main/python/sql/datasource.py
+++ b/examples/src/main/python/sql/datasource.py
@@ -54,7 +54,7 @@ def basic_datasource_example(spark):
 
     # $example on:manual_load_options_csv$
     df = spark.read.load("examples/src/main/resources/people.csv",
-                         format="csv", sep=":", inferSchema="true", header="true")
+                         format="csv", sep=";", inferSchema="true", header="true")
     # $example off:manual_load_options_csv$
 
     # $example on:manual_save_options_orc$


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