Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-266

NullPoint exception when reading not existed devices using ReadOnlyTsFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.0
    • None

    Description

      The code is:

      //代码占位符
      ReadOnlyTsFile tsFileReader = new ReadOnlyTsFile(new TsFileSequenceReader("file.tsfile"));
      ArrayList<Path> paths = new ArrayList<>();
      paths.add(new Path("system.test_cpu"));
      // no filter, should select 1 2 3 4 6 7 8
      queryAndPrint(paths, tsFileReader, null);
      tsFileReader.close();
      

      , and actually the correct path is "root.app.system.test_cpu". Now because I define an incorrect path (i.e., not exist in the tsfile), then I get an exception:

       

      WARN  [2019-10-24 06:29:41,832] [main] org.apache.iotdb.tsfile.common.conf.TSFileDescriptor:87 - Failed to find config file tsfile-format.properties at classpath, use default configuration WARN  [2019-10-24 06:29:41,832] [main] org.apache.iotdb.tsfile.common.conf.TSFileDescriptor:87 - Failed to find config file tsfile-format.properties at classpath, use default configuration Exception in thread "main" java.lang.NullPointerException at org.apache.iotdb.tsfile.read.TsFileSequenceReader.readTsDeviceMetaData(TsFileSequenceReader.java:276) at org.apache.iotdb.tsfile.read.controller.MetadataQuerierByFileImpl.loadChunkMetaDatas(MetadataQuerierByFileImpl.java:110) at org.apache.iotdb.tsfile.read.query.executor.TsFileExecutor.execute(TsFileExecutor.java:57) at org.apache.iotdb.tsfile.read.ReadOnlyTsFile.query(ReadOnlyTsFile.java:48) at cn.edu.thu.accessdata.TsFileQuery.queryAndPrint(TsFileQuery.java:30) at cn.edu.thu.accessdata.TsFileQuery.main(TsFileQuery.java:21)

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hxd Xiangdong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m