XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.5.0
    • PySpark
    • None

    Description

      Support UDTFs with empty schema, for example:

      >>> class TestUDTF:
      ...   def eval(self):
      ...     yield tuple()
      

      Currently it fails with `useArrow=True`:

      >>> udtf(TestUDTF, returnType=StructType())().collect()
      Traceback (most recent call last):
      ...
      ValueError: not enough values to unpack (expected 2, got 0)
      

      whereas without Arrow:

      >>> udtf(TestUDTF, returnType=StructType(), useArrow=False)().collect()
      [Row()]
      

      Otherwise, we should raise an error without Arrow, too, to be consistent.

      Attachments

        Activity

          People

            ueshin Takuya Ueshin
            ueshin Takuya Ueshin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: