[ 
https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15008996#comment-15008996
 ] 

kevin yu commented on SPARK-11772:
----------------------------------

Hello Greg:
I running against the latest spark, it works for me.

Type "help", "copyright", "credits" or "license" for more information.
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 1.6.0-SNAPSHOT
      /_/

Using Python version 2.7.10 (default, Jul 14 2015 19:46:27)
SparkContext available as sc, HiveContext available as sqlContext.
>>> df = sqlContext.createDataFrame([[u'ab\u0255']])
>>> df.show()
+---+
| _1|
+---+
|abɕ|
+---+

>>> 


> DataFrame.show() fails with non-ASCII strings
> ---------------------------------------------
>
>                 Key: SPARK-11772
>                 URL: https://issues.apache.org/jira/browse/SPARK-11772
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.1
>            Reporter: Greg Baker
>            Priority: Minor
>
> When given a non-ASCII string (in pyspark at least), the DataFrame.show() 
> method fails.
> {code:none}
> df = sqlContext.createDataFrame([[u'ab\u0255']])
> df.show()
> {code}
> Results in:
> {code:none}
> 15/11/16 21:36:54 INFO DAGScheduler: ResultStage 1 (showString at 
> NativeMethodAccessorImpl.java:-2) finished in 0.148 s
> 15/11/16 21:36:54 INFO DAGScheduler: Job 1 finished: showString at 
> NativeMethodAccessorImpl.java:-2, took 0.192634 s
> Traceback (most recent call last):
>   File ".../show_bug.py", line 8, in <module>
>     df.show()
>   File 
> ".../spark-1.5.2-bin-hadoop2.6/python/lib/pyspark.zip/pyspark/sql/dataframe.py",
>  line 256, in show
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0255' in 
> position 21: ordinal not in range(128)
> 15/11/16 21:36:54 INFO SparkContext: Invoking stop() from shutdown hook
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to