[ https://issues.apache.org/jira/browse/SPARK-15244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davies Liu resolved SPARK-15244. -------------------------------- Resolution: Fixed Fix Version/s: 2.0.0 Issue resolved by pull request 13097 [https://github.com/apache/spark/pull/13097] > Type of column name created with sqlContext.createDataFrame() is not > consistent. > -------------------------------------------------------------------------------- > > Key: SPARK-15244 > URL: https://issues.apache.org/jira/browse/SPARK-15244 > Project: Spark > Issue Type: Bug > Components: PySpark > Affects Versions: 2.0.0 > Environment: CentOS 7, Spark 1.6.0 > Reporter: Kazuki Yokoishi > Priority: Minor > Fix For: 2.0.0 > > > StructField() converts field name to str in __init__. > But, when list of str/unicode is passed to sqlContext.createDataFrame() as a > schema, the type of StructField.name is not converted. > To reproduce: > {noformat} > >>> schema = StructType([StructField(u"col", StringType())]) > >>> df1 = sqlContext.createDataFrame([("a",)], schema) > >>> df1.columns # "col" is str > ['col'] > >>> df2 = sqlContext.createDataFrame([("a",)], [u"col"]) > >>> df2.columns # "col" is unicode > [u'col'] > {noformat} -- 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