You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Paul Porter (JIRA)" <ji...@apache.org> on 2019/03/08 20:31:00 UTC

[jira] [Created] (SQOOP-3432) Sqoop 1.4.7 ignores zeroDateTimeBehavior flag

Paul Porter created SQOOP-3432:
----------------------------------

             Summary: Sqoop 1.4.7 ignores zeroDateTimeBehavior flag
                 Key: SQOOP-3432
                 URL: https://issues.apache.org/jira/browse/SQOOP-3432
             Project: Sqoop
          Issue Type: Bug
            Reporter: Paul Porter


I'm running Sqoop 1.4.7 in an AWS EMR cluster. I have a record in mysql with a datetime of '0000-00-00 00:00:00'. I want to override the default Sqoop behavior and round this to the next "valid" date, but Sqoop seems to be ignoring the flag I'm passing in:

/usr/bin/sqoop import --connect jdbc:mysql://[host]:[port]/[database]?zeroDateTimeBehavior=round --username [username] --password [password]--target-dir s3://target-dir --query $'select
 id as user_id,
 created_at,
 updated_at,
 deleted_at
from
 users
where $CONDITIONS'

 

The date for this record is exported as "null."



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Re: [jira] [Created] (SQOOP-3432) Sqoop 1.4.7 ignores zeroDateTimeBehavior flag

Posted by Chris Teoh <ch...@gmail.com>.
Possible solution here is to modify the query to accommodate the invalid
date with a case statement. Follow up question is, what is the next valid
date for this scenario?

On Fri., 8 Mar. 2019, 3:31 pm Paul Porter (JIRA), <ji...@apache.org> wrote:

> Paul Porter created SQOOP-3432:
> ----------------------------------
>
>              Summary: Sqoop 1.4.7 ignores zeroDateTimeBehavior flag
>                  Key: SQOOP-3432
>                  URL: https://issues.apache.org/jira/browse/SQOOP-3432
>              Project: Sqoop
>           Issue Type: Bug
>             Reporter: Paul Porter
>
>
> I'm running Sqoop 1.4.7 in an AWS EMR cluster. I have a record in mysql
> with a datetime of '0000-00-00 00:00:00'. I want to override the default
> Sqoop behavior and round this to the next "valid" date, but Sqoop seems to
> be ignoring the flag I'm passing in:
>
> /usr/bin/sqoop import --connect
> jdbc:mysql://[host]:[port]/[database]?zeroDateTimeBehavior=round --username
> [username] --password [password]--target-dir s3://target-dir --query
> $'select
>  id as user_id,
>  created_at,
>  updated_at,
>  deleted_at
> from
>  users
> where $CONDITIONS'
>
>
>
> The date for this record is exported as "null."
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v7.6.3#76005)
>