You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "xiaozhihong (Jira)" <ji...@apache.org> on 2022/04/21 09:54:00 UTC
[jira] [Created] (IOTDB-2974) It is recommended to use double quotation marks or quotation marks to insert data in the TEXT type.
xiaozhihong created IOTDB-2974:
----------------------------------
Summary: It is recommended to use double quotation marks or quotation marks to insert data in the TEXT type.
Key: IOTDB-2974
URL: https://issues.apache.org/jira/browse/IOTDB-2974
Project: Apache IoTDB
Issue Type: Improvement
Components: Core/Server
Reporter: xiaozhihong
In th CLI ,the timeseries' datatype is TEXT, but inserted data can also be inserted successfully if the data is 1 or false.
{code:java}
IoTDB> set storage group to root.ln;
Msg: The statement is executed successfully.
IoTDB> create timeseries root.ln.wf01.wt01.temperature with datatype=FLOAT,encoding=RLE;
Msg: The statement is executed successfully.
IoTDB> create timeseries root.ln.wf01.wt01.hardware with datatype=Text,encoding=PLAIN;
Msg: The statement is executed successfully.
IoTDB> show timeseries root.ln.**;
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| RLE| SNAPPY|null| null|
| root.ln.wf01.wt01.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|null| null|
+-----------------------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 2
It costs 0.010s
IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(2,1)
Msg: The statement is executed successfully.
IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(3,false)
Msg: The statement is executed successfully.
IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(4,'a')
Msg: The statement is executed successfully.
IoTDB> select hardware from root.ln.wf01.wt01;
+-----------------------------+--------------------------+
| Time|root.ln.wf01.wt01.hardware|
+-----------------------------+--------------------------+
|1970-01-01T08:00:00.002+08:00| 1|
|1970-01-01T08:00:00.003+08:00| false|
|1970-01-01T08:00:00.004+08:00| a|
+-----------------------------+--------------------------+
Total line number = 3
It costs 0.010s
{code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)