Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6984

from table escape parameter not deleted when defined with value other than '"'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.15.0
    • Fix Version/s: 1.17.0
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      When change the escape char, it's kept in the output instead of be deleted like with '"'

      Example :

      the file sample.csv :

      name|age|subject|info
      Bob|21|"lovely quotes"|none
      Bill|23|"character @"|@" pipe"|none
      
      SELECT * FROM table(tmp`sample.csv`(`escape`=>'@', type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
      

      The result is

      |  name   | age  |       subject         | info  |
      +---------+------+-----------------------+-------+
      | Bob     | 21   | lovely quotes         | none  |
      | Bill    | 23   | character @"|@" pipe  | none  |
      

      As we expect : < character "|" pipe > (without the escape char (@)  

       

      Note that we have the good behavior when using quote ('"') as escaping character

      name|age|subject|info
      Bob|21|"lovely quotes"|none
      Bill|23|"character ""|"" pipe"|none
      
      SELECT * FROM table(tmp`sample.csv`(`escape`=>'"', type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
      
      OR
      
      SELECT * FROM table(tmp`sample.csv`(type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
      

      The result is OK with

      |  name   | age  |       subject         | info  |
      +---------+------+-----------------------+-------+
      | Bob     | 21   | lovely quotes         | none  |
      | Bill    | 23   | character "|" pipe  | none  |
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                benj641 benj
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: