You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Haonan Hou (Jira)" <ji...@apache.org> on 2021/03/01 03:25:00 UTC

[jira] [Commented] (IOTDB-1158) Add nullable support for any datatype

    [ https://issues.apache.org/jira/browse/IOTDB-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17292577#comment-17292577 ] 

Haonan Hou commented on IOTDB-1158:
-----------------------------------

Hi, I just want to mention that the PR  [#2691|https://github.com/apache/iotdb/pull/2691] doesn't fix the NaN problem completely. 

You may like to check the discussion here [https://github.com/apache/iotdb/issues/2687.]

Right now, if insert NaN value with encoding type RLE or TS_2DIFF and flush the value to files. The query result will still turns to 0.0. (GORILLA is good.)

The reason is RLE and TS_2DIFF will round the double or float value with specified precision. And this will cause NaN turn to 0.0.

To fix this bug, we need to consider a better encoding way of NaN. Any idea?

> Add nullable support for any datatype
> -------------------------------------
>
>                 Key: IOTDB-1158
>                 URL: https://issues.apache.org/jira/browse/IOTDB-1158
>             Project: Apache IoTDB
>          Issue Type: New Feature
>          Components: Core/Engine
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>            Priority: Major
>         Attachments: image-2021-02-17-08-58-46-610.png, screenshot-1.png
>
>
> DDL of many databases can support not null syntax, such as MySQL [1]:
> {code:java}
> CREATE TABLE order (
>     item VARCHAR(255) NOT NULL,
>     amount FLOAT NOT NULL,
>     deal_date DATE
> );
> {code}
> A column may contain only one `NOT NULL` constraint which specifies a rule that the column must not contain any `NULL` value. In other words, by default, `NULL` value is allowed.
> For performance reasons, IoTDB does not support `NULL` value by default. Instead, it supports some business scenarios in the form of 'NaN'. As shown in the figure below:(v0.11.2)
> !image-2021-02-17-08-58-46-610.png!
> Therefore, in this JIRA., we will discuss whether we need to support `NULL` value and how to support `NULL` values in IoTDB, including session API and SQL API. I'd like to provide a draft of how to support the design, if you think this feature is necessary.
> What are your thoughts?
> [1] [https://www.mysqltutorial.org/mysql-not-null-constraint/]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)