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

Drill unable to parse json files with schema changes

    XMLWordPrintableJSON

    Details

      Description

      git.commit.id.abbrev=bb69f22

      select d.col2.col3  from reg1 d;
      Error: DATA_READ ERROR: Error parsing JSON - index: 0, length: 4 (expected: range(0, 0))
      
      File  /drill/testdata/reg1/a.json
      Record  2
      Fragment 0:0
      

      The folder reg1 contains 2 files
      File 1 : a.json

      {"col1": "val1","col2": null}
      {"col1": "val1","col2": {"col3":"abc", "col4":"xyz"}}
      

      File 2 : b.json

      {"col1": "val1","col2": null}
      {"col1": "val1","col2": null}
      

      Exception from the log file :

      [Error Id: a7e3c716-838d-4f8f-9361-3727b98f04cd ]
              at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:534) ~[drill-common-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.store.easy.json.JSONRecordReader.handleAndRaise(JSONRecordReader.java:165) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.store.easy.json.JSONRecordReader.next(JSONRecordReader.java:205) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.ScanBatch.next(ScanBatch.java:183) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:119) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:113) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:103) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:51) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:130) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:156) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:119) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:104) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:80) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:94) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:256) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:250) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_71]
              at javax.security.auth.Subject.doAs(Subject.java:415) [na:1.7.0_71]
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1595) [hadoop-common-2.7.0-mapr-1506.jar:na]
              at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:250) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
              at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
      Caused by: java.lang.IndexOutOfBoundsException: index: 0, length: 4 (expected: range(0, 0))
              at io.netty.buffer.DrillBuf.checkIndexD(DrillBuf.java:189) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:4.0.27.Final]
              at io.netty.buffer.DrillBuf.chk(DrillBuf.java:211) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:4.0.27.Final]
              at io.netty.buffer.DrillBuf.getInt(DrillBuf.java:491) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:4.0.27.Final]
              at org.apache.drill.exec.vector.UInt4Vector$Accessor.get(UInt4Vector.java:364) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.VarCharVector$Mutator.setSafe(VarCharVector.java:525) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.NullableVarCharVector$Mutator.fillEmpties(NullableVarCharVector.java:465) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.NullableVarCharVector$Mutator.setSafe(NullableVarCharVector.java:545) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.impl.NullableVarCharWriterImpl.writeVarChar(NullableVarCharWriterImpl.java:151) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.handleString(JsonReader.java:461) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.writeData(JsonReader.java:342) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.writeData(JsonReader.java:310) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.writeDataSwitch(JsonReader.java:241) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.writeToVector(JsonReader.java:179) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.vector.complex.fn.JsonReader.write(JsonReader.java:145) ~[drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
              at org.apache.drill.exec.store.easy.json.JSONRecordReader.next(JSONRecordReader.java:183) [drill-java-exec-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT]
      

        Attachments

          Activity

            People

            • Assignee:
              sphillips Steven Phillips
              Reporter:
              rkins Rahul Kumar Challapalli
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: