[
https://issues.apache.org/jira/browse/IOTDB-266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jialin Qiao closed IOTDB-266.
-----------------------------
Fix Version/s: 0.9.0
Resolution: Fixed
> NullPoint exception when reading not existed devices using ReadOnlyTsFile
> --------------------------------------------------------------------------
>
> Key: IOTDB-266
> URL: https://issues.apache.org/jira/browse/IOTDB-266
> Project: Apache IoTDB
> Issue Type: Bug
> Reporter: Xiangdong Huang
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.9.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The code is:
> {code:java}
> //代码占位符
> 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();
> {code}
> , 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)
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)