XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.2.0
    • None
    • PySpark
    • None

    Description

      To convert timestamp type to python we are using

      datetime.datetime.fromtimestamp(ts // 1000000).replace(microsecond=ts % 1000000)

      code.

      In [34]: %%timeit
          ...: datetime.datetime.fromtimestamp(1505383647).replace(microsecond=12344)
          ...:
      4.58 µs ± 558 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
      

      It's slow, because:

      1. we're trying to get TZ on every conversion
      2. we're using replace method

      Proposed solution: custom datetime conversion and move calculation of TZ to module

      Attachments

        1. profile_fact_dok.png
          347 kB
          Maciej Bryński

        Activity

          People

            Unassigned Unassigned
            maver1ck Maciej Bryński
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: