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

Unicode characters in JSON data result in DATA_READ error.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.11.0
    • Fix Version/s: None
    • Component/s: Storage - JSON
    • Labels:
      None

      Description

      Unicode characters in JSON data result in DATA_READ error.

      Apache Drill 1.11.0 commit ID : adbf363

      Data used in test.
      [root@centos-01 ~]# cat test.json
      "arr":[{u'\ue4ea\ue4ba': 5.167460680922489e+18}]
      
      apache drill 1.11.0-SNAPSHOT
      "a drill in the hand is better than two in the bush"
      0: jdbc:drill:schema=dfs.tmp> alter session set `store.json.all_text_mode`=true;
      +-------+------------------------------------+
      |  ok   |              summary               |
      +-------+------------------------------------+
      | true  | store.json.all_text_mode updated.  |
      +-------+------------------------------------+
      1 row selected (0.156 seconds)
      
      0: jdbc:drill:schema=dfs.tmp> select * from `test.json`;
      Error: DATA_READ ERROR: Failure while parsing JSON.  Found token of [VALUE_STRING].  Drill currently only supports parsing json strings that contain either lists or maps.  The root object cannot be a scalar.
      
      Line  1
      Column  3
      Field  <none>
      Fragment 0:0
      
      [Error Id: 535e08fb-89b0-443b-86dc-032e40bbb4e1 on centos-01.qa.lab:31010] (state=,code=0)
      
      2017-04-03 09:42:45,845 [271de6e9-e9f3-51bc-7091-1a2df15f12a7:foreman] INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id 271de6e9-e9f3-51bc-7091-1a2df15f12a7: select * from `test.json`
      ...
      2017-04-03 09:42:45,935 [271de6e9-e9f3-51bc-7091-1a2df15f12a7:frag:0:0] INFO  o.a.d.e.vector.complex.fn.JsonReader - User Error Occurred: Failure while parsing JSON.  Found token of [VALUE_STRING].  Drill currently only supports parsing json strings that contain either lists or maps.  The root object cannot be a scalar.
      org.apache.drill.common.exceptions.UserException: DATA_READ ERROR: Failure while parsing JSON.  Found token of [VALUE_STRING].  Drill currently only supports parsing json strings that contain either lists or maps.  The root object cannot be a scalar.
      
      Line  1
      Column  3
      Field  <none>
      
      [Error Id: 535e08fb-89b0-443b-86dc-032e40bbb4e1 ]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:544) ~[drill-common-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.writeToVector(JsonReader.java:305) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.write(JsonReader.java:217) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.store.easy.json.JSONRecordReader.next(JSONRecordReader.java:206) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.ScanBatch.next(ScanBatch.java:179) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:119) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:109) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:135) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:104) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:81) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:94) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:232) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:226) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_91]
              at javax.security.auth.Subject.doAs(Subject.java:422) [na:1.8.0_91]
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1595) [hadoop-common-2.7.0-mapr-1607.jar:na]
              at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:226) [drill-java-exec-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.11.0-SNAPSHOT.jar:1.11.0-SNAPSHOT]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              khfaraaz Khurram Faraaz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: