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

Xiangdong Huang commented on IOTDB-1158:
----------------------------------------

IMO, 

1. Supporting NOT NULL, NULL has its scenario.

We can require "NOT NULL",

 

e.g., create time series bundle/set root.sg.d1 (s1 double not null, s2 double 
not null),

which means s1 and s2 must arrive together.

 

e.g., create time series bundle/set root.sg.d1 (s1 double null, s2 double 
null), means s1 and s2 can arrive separately.

But it is the default behavior, so we can omit it.

 

Actually, it will be helpful for our next-generation TsFile format.

 

2. BUT, it only is meaningful for a time series set/bundle.  If we claim 
NULL/NOT NULL on one time series, it is strange:

 

e.g., create time series root.sg.d1.s1 NULL.

 

I do not think it is useful unless the sensor really collects a "NULL" and 
considers it as a meaningful data value.

 

 

 

 

 

 

> 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)

Reply via email to