You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Zhong Wang (Jira)" <ji...@apache.org> on 2021/11/29 03:37:00 UTC
[jira] [Assigned] (IOTDB-2064) NPE caused by map serde
[ https://issues.apache.org/jira/browse/IOTDB-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhong Wang reassigned IOTDB-2064:
---------------------------------
Assignee: Zhong Wang
> NPE caused by map serde
> -----------------------
>
> Key: IOTDB-2064
> URL: https://issues.apache.org/jira/browse/IOTDB-2064
> Project: Apache IoTDB
> Issue Type: Bug
> Affects Versions: 0.11.0, 0.12.0
> Reporter: Zhong Wang
> Assignee: Zhong Wang
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.13.0
>
>
> In TSServiceImpl#setMultiTimeSeriesPlan, the input create time series plan may not have any tag or attribute, thus createTimeSeriesPlan#getTags and createTimeSeriesPlan#getAttributes could return null. See:
> {code:java}
> private void setMultiTimeSeriesPlan(
> CreateMultiTimeSeriesPlan multiPlan, CreateTimeSeriesPlan createTimeSeriesPlan) {
> PartialPath path = createTimeSeriesPlan.getPath();
> TSDataType type = createTimeSeriesPlan.getDataType();
> TSEncoding encoding = createTimeSeriesPlan.getEncoding();
> CompressionType compressor = createTimeSeriesPlan.getCompressor();
> Map<String, String> tags = createTimeSeriesPlan.getTags();
> Map<String, String> attributes = createTimeSeriesPlan.getAttributes();
> String alias = createTimeSeriesPlan.getAlias();
> multiPlan.getPaths().add(path);
> multiPlan.getDataTypes().add(type);
> multiPlan.getEncodings().add(encoding);
> multiPlan.getCompressors().add(compressor);
> multiPlan.getTags().add(tags); // tags could be null !!!
> multiPlan.getAttributes().add(attributes); // attributes could be null !!!
> multiPlan.getAlias().add(alias);
> }
> {code}
> The serialization of CreateMultiTimeSeriesPlan calls ReadWriteIOUtils#write(List<Map<String, String>>, ByteBuffer), and for each map in the list, ReadWriteIOUtils#write(Map<String, String>, DataOutputStream) is called.
> However, ReadWriteIOUtils#write(Map<String, String>, DataOutputStream) throws NPE when the input map is null.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)