iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

How to implement this query method

Open skyplume opened this issue 3 years ago • 4 comments

For the data of the same indicator over a period of time, I want to clean out the data with the same value as the previous one, and only keep the changed data. I want to achieve the same effect as “SELECT a.id ,a.value FROM test a left join test b on a.id+1=b.id where a.value!=b.value” does, but the DML and UDF provided by querying the official website documents seem to have no way to achieve similar effects. How to achieve this effect? thank you

skyplume avatar Jul 22 '22 06:07 skyplume

Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!

github-actions[bot] avatar Jul 22 '22 06:07 github-actions[bot]

Hi, this may be implemented by a UDF. You could buffer the current data, and output the current data once you meet a different value.

qiaojialin avatar Jul 26 '22 12:07 qiaojialin

For the data of the same indicator over a period of time, I want to clean out the data with the same value as the previous one, and only keep the changed data. I want to achieve the same effect as “SELECT a.id ,a.value FROM test a left join test b on a.id+1=b.id where a.value!=b.value” does, but the DML and UDF provided by querying the official website documents seem to have no way to achieve similar effects. How to achieve this effect? thank you

Hi, we have implement a UDF as Built-in Function to do this job, you can see PR.

Wei-hao-Li avatar Aug 04 '22 02:08 Wei-hao-Li

Sorry, I just finished two weeks of sick leave. I will check the new UDF. Thank you for your help!

skyplume avatar Aug 15 '22 01:08 skyplume