Danil Kirsanov created SPARK-20563:
--------------------------------------
Summary: going to DataFrame to RDD and back changes the schema, if
the schema is not explicitly provided
Key: SPARK-20563
URL: https://issues.apache.org/jira/browse/SPARK-20563
Project: Spark
Issue Type: Bug
Components: PySpark
Affects Versions: 2.1.0
Reporter: Danil Kirsanov
Priority: Minor
df.rdd.toDF() converts the DataFrame of IntegerType to the LongType if the
schema is not explicitly provided in toDF().
Below is a full reproduction code
-------------------------------------
from pyspark.sql.types import IntegerType, StructType, StructField
schema = StructType([StructField("a",IntegerType(),True),
StructField("b",IntegerType(),True)])
df_test = spark.createDataFrame([(1,2)], schema)
df_test.printSchema()
df_test.rdd.toDF().printSchema()
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]