Yosi Pramajaya created SPARK-35657:
--------------------------------------

             Summary: createDataFrame fails while to_spark works.
                 Key: SPARK-35657
                 URL: https://issues.apache.org/jira/browse/SPARK-35657
             Project: Spark
          Issue Type: Bug
          Components: PySpark
    Affects Versions: 3.2.0
         Environment: * Apache Spark 3.2.0-SNAPSHOT (build from source)
 * Python 3.8.10
 * OpenJDK 11.0
 * pandas 1.2.4
 * pyarrow 4.0.1
            Reporter: Yosi Pramajaya


Sample code:

{{kdf = ks.DataFrame({}}
{{ 'a': [1, 2, 3],}}
{{ 'b': [2., 3., 4.],}}
{{ 'c': ['string1', 'string2', 'string3'],}}
{{ 'd': [date(2000, 1, 1), date(2000, 2, 1), date(2000, 3, 1)],}}
{{ 'e': [datetime(2000, 1, 1, 12, 0), datetime(2000, 1, 2, 12, 0), 
datetime(2000, 1, 3, 12, 0)]}}
{{ })}}{{df = kdf.to_spark() # WORKS}}
{{ df = spark.createDataFrame(kdf) # FAILED}}

Error:

{{TypeError: Can not infer schema for type: <class 'str'>}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to