Re: [jira] [Created] (IOTDB-244) wrong duplicated columns query result

2019-09-27 Thread Tian Jiang
Hi,


I would choose the latter. Reducing unnecessary network traffic sounds more 
attractive to me, besides, this may save a lot memory when the fetch size is 
quite large.


| |
Tian Jiang
|
|
jt2594...@163.com
|
签名由网易邮箱大师定制
On 9/27/2019 16:22,Lei Rui wrote:
Hi,


I find the bug and the cause is that there is divergence between the server and 
the client in treating queries with duplicated columns.


For example, I query "select s0,s0,s0,s1 from root.vehicle.d0",


The server returns the result with duplicated fields as queried.
[root.vehicle.d0.s0, root.vehicle.d0.s0, root.vehicle.d0.s0, root.vehicle.d0.s1]


However, the client assumes that the returned result has been deduplicated,
[root.vehicle.d0.s0, root.vehicle.d0.s1]
thus using a structure called `columnInfoMap` in the `IoTDBQueryResultSet`.


Before fixing this bug, we should decide who handles the duplication?
The server returns a complete result and the client just need to take,
or the server returns deduplicated result and the client do additional map task?


Lei Rui
On 9/27/2019 16:09,Lei Rui (Jira) wrote:
Lei Rui created IOTDB-244:
-

Summary: wrong duplicated columns query result
Key: IOTDB-244
URL: https://issues.apache.org/jira/browse/IOTDB-244
Project: Apache IoTDB
Issue Type: Bug
Reporter: Lei Rui


I use the following sql to insert data,


{code:java}
SET STORAGE GROUP TO root.vehicle.d0
SET STORAGE GROUP TO root.vehicle.d1
CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=INT64, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s2 WITH DATATYPE=FLOAT, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s3 WITH DATATYPE=TEXT, ENCODING=PLAIN
CREATE TIMESERIES root.vehicle.d0.s4 WITH DATATYPE=BOOLEAN, ENCODING=PLAIN
CREATE TIMESERIES root.vehicle.d1.s0 WITH DATATYPE=INT32, ENCODING=RLEinsert 
into root.vehicle.d0(timestamp,s0) values(1,101)
insert into root.vehicle.d0(timestamp,s0) values(2,198)
insert into root.vehicle.d0(timestamp,s0) values(100,99)
insert into root.vehicle.d0(timestamp,s0) values(101,99)
insert into root.vehicle.d0(timestamp,s0) values(102,80)
insert into root.vehicle.d0(timestamp,s0) values(103,99)
insert into root.vehicle.d0(timestamp,s0) values(104,90)
insert into root.vehicle.d0(timestamp,s0) values(105,99)
insert into root.vehicle.d0(timestamp,s0) values(106,99)
insert into root.vehicle.d0(timestamp,s0) values(2,1)
insert into root.vehicle.d0(timestamp,s0) values(50,1)
insert into root.vehicle.d0(timestamp,s0) values(1000,2)insert into 
root.vehicle.d0(timestamp,s1) values(1,1101)
insert into root.vehicle.d0(timestamp,s1) values(2,198)
insert into root.vehicle.d0(timestamp,s1) values(100,199)
insert into root.vehicle.d0(timestamp,s1) values(101,199)
insert into root.vehicle.d0(timestamp,s1) values(102,180)
insert into root.vehicle.d0(timestamp,s1) values(103,199)
insert into root.vehicle.d0(timestamp,s1) values(104,190)
insert into root.vehicle.d0(timestamp,s1) values(105,199)
insert into root.vehicle.d0(timestamp,s1) values(2,4)
insert into root.vehicle.d0(timestamp,s1) values(50,5)
insert into root.vehicle.d0(timestamp,s1) values(1000,5)insert into 
root.vehicle.d0(timestamp,s2) values(1000,5)
insert into root.vehicle.d0(timestamp,s2) values(2,2.22)
insert into root.vehicle.d0(timestamp,s2) values(3,3.33)
insert into root.vehicle.d0(timestamp,s2) values(4,4.44)
insert into root.vehicle.d0(timestamp,s2) values(102,10.00)
insert into root.vehicle.d0(timestamp,s2) values(105,11.11)
insert into root.vehicle.d0(timestamp,s2) values(1000,1000.11)insert into 
root.vehicle.d0(timestamp,s3) values(60,'a')
insert into root.vehicle.d0(timestamp,s3) values(70,'b')
insert into root.vehicle.d0(timestamp,s3) values(80,'c')
insert into root.vehicle.d0(timestamp,s3) values(101,'d')
insert into root.vehicle.d0(timestamp,s3) values(102,'f')insert into 
root.vehicle.d1(timestamp,s0) values(1,999)
insert into root.vehicle.d1(timestamp,s0) values(1000,888)insert into 
root.vehicle.d0(timestamp,s1) values(2000-01-01T08:00:00+08:00, 100)
insert into root.vehicle.d0(timestamp,s3) values(2000-01-01T08:00:00+08:00, 
'good')insert into root.vehicle.d0(timestamp,s4) values(100, false)
insert into root.vehicle.d0(timestamp,s4) values(100, true)
{code}
and then I query as follows:
{code:java}
IoTDB> select s0,s0,s0,s1 from root.vehicle.d0
+---+--+--+--+--+
|   
Time|root.vehicle.d0.s0|root.vehicle.d0.s0|root.vehicle.d0.s0|root.vehicle.d0.s1|
+---+--+--+--+--+
|  1970-01-01T08:00:00.001+08:00|   101|   101| 
  101|   101|
|  1970-01-01T08:00:00.002+08:00| 1| 1| 
1| 1|
| 

Re: [jira] [Created] (IOTDB-244) wrong duplicated columns query result

2019-09-27 Thread Lei Rui
Hi,


I find the bug and the cause is that there is divergence between the server and 
the client in treating queries with duplicated columns.


For example, I query "select s0,s0,s0,s1 from root.vehicle.d0",


The server returns the result with duplicated fields as queried. 
[root.vehicle.d0.s0, root.vehicle.d0.s0, root.vehicle.d0.s0, root.vehicle.d0.s1]


However, the client assumes that the returned result has been deduplicated,
[root.vehicle.d0.s0, root.vehicle.d0.s1]
thus using a structure called `columnInfoMap` in the `IoTDBQueryResultSet`.


Before fixing this bug, we should decide who handles the duplication?
The server returns a complete result and the client just need to take, 
or the server returns deduplicated result and the client do additional map task?


Lei Rui
On 9/27/2019 16:09,Lei Rui (Jira) wrote:
Lei Rui created IOTDB-244:
-

Summary: wrong duplicated columns query result
Key: IOTDB-244
URL: https://issues.apache.org/jira/browse/IOTDB-244
Project: Apache IoTDB
Issue Type: Bug
Reporter: Lei Rui


I use the following sql to insert data, 

 
{code:java}
SET STORAGE GROUP TO root.vehicle.d0
SET STORAGE GROUP TO root.vehicle.d1
CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=INT64, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s2 WITH DATATYPE=FLOAT, ENCODING=RLE
CREATE TIMESERIES root.vehicle.d0.s3 WITH DATATYPE=TEXT, ENCODING=PLAIN
CREATE TIMESERIES root.vehicle.d0.s4 WITH DATATYPE=BOOLEAN, ENCODING=PLAIN
CREATE TIMESERIES root.vehicle.d1.s0 WITH DATATYPE=INT32, ENCODING=RLEinsert 
into root.vehicle.d0(timestamp,s0) values(1,101)
insert into root.vehicle.d0(timestamp,s0) values(2,198)
insert into root.vehicle.d0(timestamp,s0) values(100,99)
insert into root.vehicle.d0(timestamp,s0) values(101,99)
insert into root.vehicle.d0(timestamp,s0) values(102,80)
insert into root.vehicle.d0(timestamp,s0) values(103,99)
insert into root.vehicle.d0(timestamp,s0) values(104,90)
insert into root.vehicle.d0(timestamp,s0) values(105,99)
insert into root.vehicle.d0(timestamp,s0) values(106,99)
insert into root.vehicle.d0(timestamp,s0) values(2,1)
insert into root.vehicle.d0(timestamp,s0) values(50,1)
insert into root.vehicle.d0(timestamp,s0) values(1000,2)insert into 
root.vehicle.d0(timestamp,s1) values(1,1101)
insert into root.vehicle.d0(timestamp,s1) values(2,198)
insert into root.vehicle.d0(timestamp,s1) values(100,199)
insert into root.vehicle.d0(timestamp,s1) values(101,199)
insert into root.vehicle.d0(timestamp,s1) values(102,180)
insert into root.vehicle.d0(timestamp,s1) values(103,199)
insert into root.vehicle.d0(timestamp,s1) values(104,190)
insert into root.vehicle.d0(timestamp,s1) values(105,199)
insert into root.vehicle.d0(timestamp,s1) values(2,4)
insert into root.vehicle.d0(timestamp,s1) values(50,5)
insert into root.vehicle.d0(timestamp,s1) values(1000,5)insert into 
root.vehicle.d0(timestamp,s2) values(1000,5)
insert into root.vehicle.d0(timestamp,s2) values(2,2.22)
insert into root.vehicle.d0(timestamp,s2) values(3,3.33)
insert into root.vehicle.d0(timestamp,s2) values(4,4.44)
insert into root.vehicle.d0(timestamp,s2) values(102,10.00)
insert into root.vehicle.d0(timestamp,s2) values(105,11.11)
insert into root.vehicle.d0(timestamp,s2) values(1000,1000.11)insert into 
root.vehicle.d0(timestamp,s3) values(60,'a')
insert into root.vehicle.d0(timestamp,s3) values(70,'b')
insert into root.vehicle.d0(timestamp,s3) values(80,'c')
insert into root.vehicle.d0(timestamp,s3) values(101,'d')
insert into root.vehicle.d0(timestamp,s3) values(102,'f')insert into 
root.vehicle.d1(timestamp,s0) values(1,999)
insert into root.vehicle.d1(timestamp,s0) values(1000,888)insert into 
root.vehicle.d0(timestamp,s1) values(2000-01-01T08:00:00+08:00, 100)
insert into root.vehicle.d0(timestamp,s3) values(2000-01-01T08:00:00+08:00, 
'good')insert into root.vehicle.d0(timestamp,s4) values(100, false)
insert into root.vehicle.d0(timestamp,s4) values(100, true)
{code}
and then I query as follows:
{code:java}
IoTDB> select s0,s0,s0,s1 from root.vehicle.d0
+---+--+--+--+--+
|   
Time|root.vehicle.d0.s0|root.vehicle.d0.s0|root.vehicle.d0.s0|root.vehicle.d0.s1|
+---+--+--+--+--+
|  1970-01-01T08:00:00.001+08:00|   101|   101| 
  101|   101|
|  1970-01-01T08:00:00.002+08:00| 1| 1| 
1| 1|
|  1970-01-01T08:00:00.050+08:00| 1| 1| 
1| 1|
|  1970-01-01T08:00:00.100+08:00|99|99| 
   99|99|
|