[jira] [Commented] (SPARK-11772) DataFrame.show() fails with non-ASCII strings
[ https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 > 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
[jira] [Commented] (SPARK-11772) DataFrame.show() fails with non-ASCII strings
[ https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15009620#comment-15009620 ] Greg Baker commented on SPARK-11772: Having looked at it more, it seems like this is less a Spark bug than an undesirable behaviour of Python. http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python If I set PYTHONIOENCODING=utf8 for the command, it outputs fine. > 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 > 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
[jira] [Commented] (SPARK-11772) DataFrame.show() fails with non-ASCII strings
[ https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15010358#comment-15010358 ] kevin yu commented on SPARK-11772: -- Hello Greg: Glad you find solution. Can we close this jira? Thanks. > 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 > 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
[jira] [Commented] (SPARK-11772) DataFrame.show() fails with non-ASCII strings
[ https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15010386#comment-15010386 ] Greg Baker commented on SPARK-11772: Yes... I guess it's not sensible to blame this on Spark :P Thanks for the help! > 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 > 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
[jira] [Commented] (SPARK-11772) DataFrame.show() fails with non-ASCII strings
[ https://issues.apache.org/jira/browse/SPARK-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15008096#comment-15008096 ] Greg Baker commented on SPARK-11772: Also occurs in 1.5.2, which I can't select in the JIRA issue. > 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 > 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