[
https://issues.apache.org/jira/browse/SQOOP-1845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234979#comment-14234979
]
Qian Xu edited comment on SQOOP-1845 at 12/5/14 3:06 AM:
---------------------------------------------------------
{code}
for (String dateTime : new String[] { "'2014-10-01 12:00:00'", "'2014-10-01
12:00:00.000'" }) {
dataFormat.setTextData(dateTime);
assertEquals("2014-10-01T12:00:00.000-07:00",
dataFormat.getObjectData()[0].toString());
}
{code}
I see three problems here:
1. The input datetime string is local time (no timezone indicator at the end),
so the expected result should not have a timezone indicator.
2. If there is a need to add timezone indicator, then mock related
{{getTimeZone}} method in {{setUp}} rather than hard coding, because the build
system might have a different timezone setting.
3. {{12:00:00.000}} should be coverted to {{12:00:00}}. The tailing {{.000}}
should be omit.
was (Author: stanleyxu2005):
{code}
for (String dateTime : new String[] { "'2014-10-01 12:00:00'", "'2014-10-01
12:00:00.000'" }) {
dataFormat.setTextData(dateTime);
assertEquals("2014-10-01T12:00:00.000-07:00",
dataFormat.getObjectData()[0].toString());
}
{code}
I see two problems here:
1. The input datetime string is local time (no time zone indicator at the end),
so the expected result should not have a time zone indicator.
2. {{12:00:00.000}} should be coverted to {{12:00:00}}. The tailing {{.000}}
should be omit.
> Integration test failed due to different timezone
> -------------------------------------------------
>
> Key: SQOOP-1845
> URL: https://issues.apache.org/jira/browse/SQOOP-1845
> Project: Sqoop
> Issue Type: Bug
> Reporter: Richard
>
> test testDateTimeISO8601Alternative in TestCSVIntermediateDataFormat
> {code}
> assertEquals("2014-10-01T12:00:00.000-07:00",
> dataFormat.getObjectData()[0].toString());
> {code}
> failed with such error message:
> {code}
> org.junit.ComparisonFailure:
> Expected :2014-10-01T12:00:00.000-07:00
> Actual :2014-10-01T12:00:00.000+08:00
> {code}
> seems issue of a different timezone, you are @ -7, and I am @ +8.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)