Allison Wang created SPARK-44561:
------------------------------------

             Summary: Fix AssertionError when converting UDTF output to a 
complex type
                 Key: SPARK-44561
                 URL: https://issues.apache.org/jira/browse/SPARK-44561
             Project: Spark
          Issue Type: Sub-task
          Components: PySpark
    Affects Versions: 3.5.0
            Reporter: Allison Wang


{code:java}
class TestUDTF:
    def eval(self):
        yield {'a': 1, 'b': 2},

udtf(TestUDTF, returnType="x: map<string,int>")().show() {code}
This will fail with:

  File "pandas/_libs/lib.pyx", line 2834, in pandas._libs.lib.map_infer
  File "python/pyspark/sql/pandas/types.py", line 804, in convert_map
    assert isinstance(value, dict)
AssertionError

Same for `convert_struct`



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to