iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

[IOTDB-2974] It is recommended to use double quotation marks or quotation marks to insert data in the TEXT type.

Open 23931017wu opened this issue 3 years ago • 4 comments

An exception is thrown for insertion of TEXT types that that is not quoted or double quoted.

23931017wu avatar Jun 06 '22 09:06 23931017wu

Before: IoTDB> set storage group to root.ln; 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; 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; create timeseries root.ln.wf01.wt01.hardware with datatype=Text,encoding=PLAIN; Msg: The statement is executed successfully. IoTDB> show timeseries root.ln.; 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.076s IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(2,1) 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) 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') 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; 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 2.893s IoTDB> image

After: IoTDB> set storage group to root.ln; 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; 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; create timeseries root.ln.wf01.wt01.hardware with datatype=Text,encoding=PLAIN; Msg: The statement is executed successfully. IoTDB> show timeseries root.ln.; 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.414s IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(2,1) insert into root.ln.wf01.wt01(timestamp, hardware) values(2,1) Msg: 313: failed to insert measurements [hardware] caused by The data type of TEXT should be a sequence of bytes or characters, enclosed within either single quote (') or double quote (") characters. IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(3,false) insert into root.ln.wf01.wt01(timestamp, hardware) values(3,false) Msg: 313: failed to insert measurements [hardware] caused by The data type of TEXT should be a sequence of bytes or characters, enclosed within either single quote (') or double quote (") characters. IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(4,'a') insert into root.ln.wf01.wt01(timestamp, hardware) values(4,'a') Msg: The statement is executed successfully. IoTDB> insert into root.ln.wf01.wt01(timestamp, hardware) values(5,"b") insert into root.ln.wf01.wt01(timestamp, hardware) values(5,"b") Msg: The statement is executed successfully. IoTDB> select hardware from root.ln.wf01.wt01; select hardware from root.ln.wf01.wt01; +-----------------------------+--------------------------+ | Time|root.ln.wf01.wt01.hardware| +-----------------------------+--------------------------+ |1970-01-01T08:00:00.004+08:00| a| |1970-01-01T08:00:00.005+08:00| b| +-----------------------------+--------------------------+ Total line number = 2 It costs 0.696s IoTDB> image image

23931017wu avatar Jun 06 '22 09:06 23931017wu

Hi, some tests failed, PTAL.

HTHou avatar Jun 06 '22 12:06 HTHou

Hi, some tests failed, PTAL.

Let me see!

23931017wu avatar Jun 07 '22 01:06 23931017wu

These tests failed because the previous ones involved TEXT tests that did not use quotes.

23931017wu avatar Jun 07 '22 05:06 23931017wu