[ https://issues.apache.org/jira/browse/SPARK-35657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17358228#comment-17358228 ]
Kevin Su edited comment on SPARK-35657 at 6/6/21, 10:33 PM: ------------------------------------------------------------ *spark.createDataFrame,* it doesn't support create from databricks.koalas. It can only create a DataFrame from an RDD, a list or a pandas.DataFrame. [https://spark.apache.org/docs/3.1.1/api/python/reference/api/pyspark.sql.SparkSession.createDataFrame.html] was (Author: pingsutw): *spark.createDataFrame,* it doesn't support create from databricks.koalas. It only can create a DataFrame from an RDD, a list or a pandas.DataFrame. https://spark.apache.org/docs/3.1.1/api/python/reference/api/pyspark.sql.SparkSession.createDataFrame.html > 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 > Priority: Major > > 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