Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-10162

PySpark filters with datetimes mess up when datetimes have timezones.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • PySpark
    • None

    Description

      PySpark appears to ignore timezone information when filtering on (and working in general with) datetimes.

      Please see the example below. The generated filter in the query plan is 5 hours off (my computer is EST).

      In [1]: df = sc.sql.createDataFrame([], StructType([StructField("dt", TimestampType())]))
      
      In [2]: df.filter(df.dt > datetime(2000, 01, 01, tzinfo=UTC)).explain()
      Filter (dt#9 > 946702800000000)
       Scan PhysicalRDD[dt#9]
      

      Note that 946702800000000 == Sat 1 Jan 2000 05:00:00 UTC

      Attachments

        Activity

          People

            0x0fff Alexey Grishchenko
            kevincox Kevin Cox
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: