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

Veena Basavaraj commented on SQOOP-1915:
----------------------------------------

I looked at your data carefully, the issue is with how the data is enclosed, 
the CSB IDF spec says enclose with single quotes and not double, so the 
following is how the hello world should be given if it needs to have the double 
qutotes around it as a input

{code}


  @Test
  public void testInputAsCSVTextInObjectOutWithSingleColumn() {

    String testData = "'\"hello, world\"'";
    Schema schema = new Schema("test");
    schema.addColumn(new Text("text"));

    dataFormat.setSchema(schema);
    dataFormat.setCSVTextData(testData);

    Object[] out = dataFormat.getObjectData();
    assertEquals("\"hello, world\"",out[0]);
  }

{code}

> sqoop2: parseCSV in CSVIDF doesn't correctly parse strings with commas
> ----------------------------------------------------------------------
>
>                 Key: SQOOP-1915
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1915
>             Project: Sqoop
>          Issue Type: Sub-task
>            Reporter: Gwen Shapira
>            Assignee: Veena Basavaraj
>         Attachments: SQOOP-1915.patch
>
>
> When creating a CSVIDF with a schema containing a single field (string or 
> binary), then using setText("\"hello, world\"")  and then getObjectData(), I 
> expect to get an array, containing a string with "hello, world".
> Actual result:
> org.apache.sqoop.common.SqoopException: 
> CSV_INTERMEDIATE_DATA_FORMAT_0005:Wrong number of columns. - The data "hello, 
> world" has the wrong number of fields.



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

Reply via email to