You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2023/08/28 02:07:00 UTC
[jira] [Created] (SPARK-44980) createDataFrame should respect the names namedtuples properly
Hyukjin Kwon created SPARK-44980:
------------------------------------
Summary: createDataFrame should respect the names namedtuples properly
Key: SPARK-44980
URL: https://issues.apache.org/jira/browse/SPARK-44980
Project: Spark
Issue Type: Bug
Components: Connect, PySpark
Affects Versions: 3.5.0
Reporter: Hyukjin Kwon
{code}
from collections import namedtuple
MyTuple = namedtuple("MyTuple", ["zz", "b", "a"])
df = spark.createDataFrame([MyTuple(1, 2, 3), MyTuple(11, 22, 33)], "a: long, b: long, zz: long")
df.show()
{code}
{code}
+---+---+---+
| a| b| zz|
+---+---+---+
| 1| 2| 3|
| 11| 22| 33|
+---+---+---+
{code}
should be
{code}
+---+---+---+
| a| b| zz|
+---+---+---+
| 3| 2| 1|
| 33| 22| 11|
+---+---+---+
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org