You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Veena Basavaraj (JIRA)" <ji...@apache.org> on 2014/11/21 01:45:33 UTC

[jira] [Comment Edited] (SQOOP-1765) Time /Timestamp format support for IDF

    [ https://issues.apache.org/jira/browse/SQOOP-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14220314#comment-14220314 ] 

Veena Basavaraj edited comment on SQOOP-1765 at 11/21/14 12:45 AM:
-------------------------------------------------------------------

1. we use JODA for date and Date time. So time should just use the same as well.  So there is no need to use any date formatter to just support 

hh:mm:ss format. 

So 08:32:33 is invalid use case and should just fail. AM I correct?




{code}


  @Test
  public void testDate() {
    Schema schema = new Schema("test");
    schema.addColumn(new Date("1"));
    dataFormat.setSchema(schema);

    dataFormat.setTextData("2014-10-01");
    assertEquals("2014-10-01", dataFormat.getObjectData()[0].toString());
  }

  @Test
  public void testDateTime() {
    Schema schema = new Schema("test");
    schema.addColumn(new DateTime("1"));
    dataFormat.setSchema(schema);

    for (String dateTime : new String[]{
        "2014-10-01T12:00:00",
        "2014-10-01T12:00:00.000"
    }) {
      dataFormat.setTextData(dateTime);
      assertEquals("2014-10-01T12:00:00.000", dataFormat.getObjectData()[0].toString());
    }
  }
{code}


was (Author: vybs):
1. we use JODA for date and Date time. So time should just use the same as well.  So there is no need to use any date formatter to just support 

hh:mm:ss format. 


{code}


  @Test
  public void testDate() {
    Schema schema = new Schema("test");
    schema.addColumn(new Date("1"));
    dataFormat.setSchema(schema);

    dataFormat.setTextData("2014-10-01");
    assertEquals("2014-10-01", dataFormat.getObjectData()[0].toString());
  }

  @Test
  public void testDateTime() {
    Schema schema = new Schema("test");
    schema.addColumn(new DateTime("1"));
    dataFormat.setSchema(schema);

    for (String dateTime : new String[]{
        "2014-10-01T12:00:00",
        "2014-10-01T12:00:00.000"
    }) {
      dataFormat.setTextData(dateTime);
      assertEquals("2014-10-01T12:00:00.000", dataFormat.getObjectData()[0].toString());
    }
  }
{code}

> Time /Timestamp format support for IDF
> --------------------------------------
>
>                 Key: SQOOP-1765
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1765
>             Project: Sqoop
>          Issue Type: Sub-task
>          Components: sqoop2-framework
>            Reporter: Veena Basavaraj
>            Assignee: Veena Basavaraj
>             Fix For: 1.99.5
>
>
> Based on the intermediate format proposal the correct Time format should be: HH:MM:DD[.ZZZZZZ][+/-XX]
> https://cwiki.apache.org/confluence/display/SQOOP/Sqoop2+Intermediate+representation#Sqoop2Intermediaterepresentation-Intermediateformatrepresentationproposal
> Can we add the missing parts?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)