[ https://issues.apache.org/jira/browse/SPARK-42982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-42982. ---------------------------------- Fix Version/s: 3.5.0 Resolution: Fixed Issue resolved by pull request 40760 [https://github.com/apache/spark/pull/40760] > Fix createDataFrame from pandas with map type > --------------------------------------------- > > Key: SPARK-42982 > URL: https://issues.apache.org/jira/browse/SPARK-42982 > Project: Spark > Issue Type: Sub-task > Components: Connect > Affects Versions: 3.4.0 > Reporter: Takuya Ueshin > Assignee: Takuya Ueshin > Priority: Major > Fix For: 3.5.0 > > > {code:python} > >>> import pandas as pd > >>> > >>> map_data = [{"a": 1}, {"b": 2, "c": 3}, {}, None, {"d": None}] > >>> pdf = pd.DataFrame({"id": [0, 1, 2, 3, 4], "m": map_data}) > >>> schema = "id long, m map<string, long>" > >>> spark.createDataFrame(pdf, schema=schema) > Traceback (most recent call last): > ... > pyspark.errors.exceptions.connect.AnalysisException: > [INVALID_COLUMN_OR_FIELD_DATA_TYPE] Column or field `col_1` is of type > "STRUCT<col_0: BIGINT, col_1: BIGINT, col_2: BIGINT, col_3: VOID>" while it's > required to be "MAP<STRING, BIGINT>". > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org