Search code examples
time-seriesuser-defined-functionsapache-iotdb

How to store the physical quanties in udf to trigger the function when one field has value and multiple fields has no value in Apache IoTDB?


If I have a device that has 100 physical quantities, and I want the data to be stored in Apache IoTDB only when it changes. From the physical quantities, only 5 of them may change frequently, and the other 95 rarely change. I want to know if I can only store the 100 fields of this device in an aligned time series? I wrote a customized udf function, computeFault(f1,f2,f3,f4,f5) that needs to insert these 5 fields. I found that if they are not aligned, as long as one of the fields is empty, this function cannot be triggered. Then I tried using aligned time series and it can be triggered. Therefore I want to know, can I only use aligned time series in this case?


Solution

  • You should not need to set all time series to be aligned to activiate the UDF you wrote, since Apache IoTDB will not perform empty value filtering when performing UDF. If any value included in udf is not empty (which should be your case), the UDF will normally be called. You can check if you already completed all settings you said, for example if you already created the time series, f2 to f5. If you haven't created these time series yet, you may not be able to activate your UDF.