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

Support JsonParser Feature 'ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER' in JsonReader

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.15.0, 1.16.0
    • 1.16.0
    • Storage - JSON

    Description

      Some JSON files may have strings with backslashes - which are read as escape characters. By default only standard escape characters are allowed. So querying such files would fail. For example see:

      Data

      {"file":"C:\Sfiles\escape.json"}
      

      Error

      (com.fasterxml.jackson.core.JsonParseException) Unrecognized character escape 'S' (code 83)
       at [Source: (org.apache.drill.exec.store.dfs.DrillFSDataInputStream); line: 1, column: 178]
          com.fasterxml.jackson.core.JsonParser._constructError():1804
          com.fasterxml.jackson.core.base.ParserMinimalBase._reportError():663
          com.fasterxml.jackson.core.base.ParserMinimalBase._handleUnrecognizedCharacterEscape():640
          com.fasterxml.jackson.core.json.UTF8StreamJsonParser._decodeEscaped():3243
          com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipString():2537
          com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken():683
          org.apache.drill.exec.vector.complex.fn.JsonReader.writeData():342
          org.apache.drill.exec.vector.complex.fn.JsonReader.writeDataSwitch():298
          org.apache.drill.exec.vector.complex.fn.JsonReader.writeToVector():246
          org.apache.drill.exec.vector.complex.fn.JsonReader.write():205
          org.apache.drill.exec.store.easy.json.JSONRecordReader.next():216
          org.apache.drill.exec.physical.impl.ScanBatch.internalNext():223
      ...
      ...
      

      Attachments

        Issue Links

          Activity

            People

              agirish Abhishek Girish
              agirish Abhishek Girish
              Sorabh Hamirwasia Sorabh Hamirwasia
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: