From dev-return-35653-archive-asf-public=cust-asf.ponee.io@sqoop.apache.org Tue Feb 20 16:51:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8D19918067E for ; Tue, 20 Feb 2018 16:51:04 +0100 (CET) Received: (qmail 51475 invoked by uid 500); 20 Feb 2018 15:51:03 -0000 Mailing-List: contact dev-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sqoop.apache.org Delivered-To: mailing list dev@sqoop.apache.org Received: (qmail 51458 invoked by uid 99); 20 Feb 2018 15:51:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2018 15:51:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0B291C2E59 for ; Tue, 20 Feb 2018 15:51:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id lRmdxAEtJe9o for ; Tue, 20 Feb 2018 15:51:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 80DF65F58B for ; Tue, 20 Feb 2018 15:51:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BF15EE021A for ; Tue, 20 Feb 2018 15:51:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 521C221E59 for ; Tue, 20 Feb 2018 15:51:00 +0000 (UTC) Date: Tue, 20 Feb 2018 15:51:00 +0000 (UTC) From: "Attila Szabo (JIRA)" To: dev@sqoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SQOOP-3288) Incremental import's upper bound ignores session time zone in Oracle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SQOOP-3288?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1637= 0164#comment-16370164 ]=20 Attila Szabo commented on SQOOP-3288: ------------------------------------- [~dvoros], Please link the review board as well! Next time please do not forgot to fill out the fix version (it's incredible= =C2=A0useful when someone grooming these things for a release=C2=A0!!!=C2= =A0) Have you considered the usage of SYSTIMESTAMP? AFAIK it's a timezone aware = timestamp. Cheers, [~maugli] > Incremental import's upper bound ignores session time zone in Oracle > -------------------------------------------------------------------- > > Key: SQOOP-3288 > URL: https://issues.apache.org/jira/browse/SQOOP-3288 > Project: Sqoop > Issue Type: Bug > Components: connectors/oracle > Affects Versions: 1.4.7 > Reporter: Daniel Voros > Assignee: Daniel Voros > Priority: Major > Fix For: 1.5.0 > > Attachments: SQOOP-3288.1.patch > > > At the moment we're using [{{SELECT SYSDATE FROM dual}}|https://github.co= m/apache/sqoop/blob/3153c3610da7e5db388bfb14f3681d308e9e89c6/src/java/org/a= pache/sqoop/manager/OracleManager.java#L652] when getting current time from= Oracle. > SYSDATE returns the underlying operating system's current time, while CUR= RENT_TIMESTAMP uses the session time zone. This could lead to problems duri= ng incremental imports *when Oracle's time zone is different from the OS*. > Consider the following scenario when Oracle is configured to {{+0:00}}, w= hile the OS is {{+5:00}}: > ||Oracle time||OS time||Event|| > |2:00|7:00|{{sqoop import --last-value 1:00 ...}} =3D> imports {{[1:00, 7= :00)}}| > |2:30|7:30|{{update ... set last_updated =3D current_timestamp ...}} =3D>= set to {{2:30}} *Won't be imported!*| > |3:00|8:00|{{sqoop import --last-value 7:00 ...}} =3D> imports {{[7:00, 8= :00)}}| > This way records updated within 5 hours after the last sqoop import won't= get imported. > Please note, that the example above assumes, that the user/administrator = who's updating the Oracle table will use the current session time of Oracle= when setting the "last updated" column of the table. > I think the solution is to use CURRENT_TIMESTAMP instead of SYSDATE. Othe= r connection managers, like MySQL or PostgreSQL are using that as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)