Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2051

[Python] Support serializing UUID objects to tables

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Later
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: Python
    • Labels:
      None

      Description

      UUID objects can be easily supported and can be represented as 128-bit integers or a stream of bytes.

      The fastest way I know to construct a UUID object is by using it's 128-bit (16 bytes) integer representation.

       

      %timeit uuid.UUID(int=24197857161011715162171839636988778104)
      611 ns ± 6.27 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
      %timeit uuid.UUID(bytes=b'\x124Vx\x124Vx\x124Vx\x124Vx')
      1.17 µs ± 7.5 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
      %timeit uuid.UUID('12345678-1234-5678-1234-567812345678')
      1.47 µs ± 6.08 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
      

       

      Right now I have to do this manually which is pretty tedious.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              the_drow Omer Katz
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: