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: [email protected]
For additional commands, e-mail: [email protected]