apache / apache/iotdb

Bug about inserting NaN

Open
#2,687 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

# version 0.11.2:

```
IoTDB> INSERT INTO root.happy.device1.sensor1(timestamp,temperature) values(7925, NaN)
Msg: 500: For input string: "NaN"
```

# version master(0.12.0-SNAPSHOT):

## if not created before, print NaN

```
IoTDB> INSERT INTO root.happy.device1.sensor1(timestamp,temperature) values(7925, NaN)
IoTDB> select * from root
+-----------------------------+--------------------------------------+
| Time|root.happy.device1.sensor1.temperature|
+-----------------------------+--------------------------------------+
|1970-01-01T08:00:07.925+08:00| NaN|
+-----------------------------+--------------------------------------+
```

## if created before, print 0.0

```
IoTDB> CREATE TIMESERIES root.happy.device1.sensor1.temperature WITH DATATYPE=DOUBLE, ENCODING=RLE
IoTDB> INSERT INTO root.happy.device1.sensor1(timestamp,temperature) values(7925, NaN)
IoTDB> select * from root
+-----------------------------+--------------------------------------+
| Time|root.happy.device1.sensor1.temperature|
+-----------------------------+--------------------------------------+
|1970-01-01T08:00:07.925+08:00| 0.0|
+-----------------------------+--------------------------------------+
```

Should print NaN

Contributor guide

Open the contributing guide

Research direction

Reproduce the two INSERT cases from the issue in the IoTDB CLI, including the pre-created DOUBLE timeseries, and compare the displayed values. Trace the INSERT handling for the NaN literal and the DOUBLE timeseries path; done means both cases preserve and display NaN instead of an error or 0.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.