Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-423

Sqoop import of timestamps to Avro from Postgres - Timezone Issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.3.0
    • None
    • None
    • None

    Description

      I am running sqoop-1.3.0-cdh3u2 on a Mac and when I sqoop import from a postgres table with columns of type 'timestamp without time zone', they are converted to longs in the time zone of my local operating system, even after I have started Hadoop up with TZ=GMT or passed in HADOOP_OPTS="-Duser.timezone=GMT". My ultimate goal is to sqoop import into long representations that are in GMT timezone rather than my operating system's timezone.

      Postgres example:

      acamp_id |     start_time      |      end_time       
      ----------+---------------------+---------------------
             1 | 2008-01-01 00:00:00 | 2011-12-16 00:00:00
      

      After import, you can see the values are 8 hours ahead, even with TZ=GMT and user.timezone set properly (this is the json representation of the parsed imported avro file):

      {"acamp_id": 1, "end_time": 1324022400000, "start_time": 1199174400000}
      

      date utility invocation:

      lynngoh@unknown:~$ date -u -r 1199174400
      Tue Jan  1 08:00:00 UTC 2008
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            lgoh Lynn Goh
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: