Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/500#discussion_r67027826
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/TestSelectWithOption.java ---
    @@ -89,30 +88,51 @@ public void testTabFieldDelimiter() throws Exception {
             listOf("2", "b"));
       }
     
    -  @Test @Ignore // It does not look like lineDelimiter is working
    -  public void testTextLineDelimiter() throws Exception {
    +  @Test
    +  public void testSingleTextLineDelimiter() throws Exception {
    +    String tableName = genCSVTable("testSingleTextLineDelimiter",
    +        "a|b|c");
    +
    +    testWithResult(format("select columns from table(%s(type => 'TeXT', 
lineDelimiter => '|'))", tableName),
    +        listOf("a"),
    +        listOf("b"),
    +        listOf("c"));
    +  }
    +
    +  @Test
    +  // '\n' is treated as standard delimiter
    +  // if user has indicated custom line delimiter but input file contains 
'\n', split will occur on both
    +  public void testCustomTextLineDelimiterAndNewLine() throws Exception {
         String tableName = genCSVTable("testTextLineDelimiter",
    -        "\"b\"|\"0\"",
    -        "\"b\"|\"1\"",
    -        "\"b\"|\"2\"");
    +        "b|1",
    +        "b|2");
     
         testWithResult(format("select columns from table(%s(type => 'TeXT', 
lineDelimiter => '|'))", tableName),
    -        listOf("\"b\""),
    -        listOf("\"0\"", "\"b\""),
    -        listOf("\"1\"", "\"b\""),
    -        listOf("\"2\"")
    -      );
    +        listOf("b"),
    --- End diff --
    
    The original test has the data with quotes around it. Why change it? That 
is a legitimate case that should be handled correctly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to