From dev-return-35667-archive-asf-public=cust-asf.ponee.io@sqoop.apache.org Wed Feb 21 18:03: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 CAAF618061A for ; Wed, 21 Feb 2018 18:03:04 +0100 (CET) Received: (qmail 55211 invoked by uid 500); 21 Feb 2018 17:03: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 55198 invoked by uid 99); 21 Feb 2018 17:03:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2018 17:03:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CE2A9180347 for ; Wed, 21 Feb 2018 17:03:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Hm-nyOlnKhVj for ; Wed, 21 Feb 2018 17:03:01 +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 4B0ED5F27B for ; Wed, 21 Feb 2018 17:03: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 97CA1E0254 for ; Wed, 21 Feb 2018 17:03: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 34B752108B for ; Wed, 21 Feb 2018 17:03:00 +0000 (UTC) Date: Wed, 21 Feb 2018 17:03:00 +0000 (UTC) From: "Daniel Voros (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: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SQOOP-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371674#comment-16371674 ] Daniel Voros commented on SQOOP-3288: ------------------------------------- Great, thank you [~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.com/apache/sqoop/blob/3153c3610da7e5db388bfb14f3681d308e9e89c6/src/java/org/apache/sqoop/manager/OracleManager.java#L652] when getting current time from Oracle. > SYSDATE returns the underlying operating system's current time, while CURRENT_TIMESTAMP uses the session time zone. This could lead to problems during incremental imports *when Oracle's time zone is different from the OS*. > Consider the following scenario when Oracle is configured to {{+0:00}}, while the OS is {{+5:00}}: > ||Oracle time||OS time||Event|| > |2:00|7:00|{{sqoop import --last-value 1:00 ...}} => imports {{[1:00, 7:00)}}| > |2:30|7:30|{{update ... set last_updated = current_timestamp ...}} => set to {{2:30}} *Won't be imported!*| > |3:00|8:00|{{sqoop import --last-value 7:00 ...}} => 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. Other connection managers, like MySQL or PostgreSQL are using that as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)