Hello Jialin
Yes digital time does look better - this is how I will access it through JDBC anyway. I treat all times as Long. Unless I am mistaken a time column must be returned via UDTF - if you look at IoTDB-Quality UDTFDistinct it returns a incrementing Long value as the time column. The UTDF method to put the values together only accepts two parameters ie time and a value. Initially I wanted to return Col1 (Distinct Values) and Col2 (Count as Int) but at this release it looks like you have to return Col1 (Time) and Col2 (A computed value) - so at this version it does not look possible to return more than 1 computed value so using the time column is just a work around to get the count in the results. Not ideal but gets the job done. Thanks Trevor ---- On Tue, 02 Nov 2021 14:07:03 +1300 Jialin Qiao <[email protected]> wrote ---- Hi, Digital time looks more intuitive. Besides, could we rename the column from time to count in UDF? @mailto:[email protected] <mailto:[email protected]> Thanks, ————————————————— Jialin Qiao Trevor Hart <mailto:[email protected]> 于2021年11月2日周二 上午6:09写道: > I have put my first UDTF on GitHub - https://github.com/ope-nz/iotDBExtras > > > > The first function I have developed is called UDTFDistinctCount. It > returns the distinct values (similar to IoTDB-Quality UDTFDistinct) but it > includes the count of each distinct values (as the time column). > > > > Example query; > > > > IoTDB> select distinct_count(temperature) from root.ln.wf01.wt01 > > > +-----------------------------+---------------------------------------------+ > > | > Time|distinct_count(root.ln.wf01.wt01.temperature)| > > > +-----------------------------+---------------------------------------------+ > > |1970-01-01T12:00:00.020+12:00| > 24.37| > > |1970-01-01T12:00:00.009+12:00| > 24.12| > > |1970-01-01T12:00:00.016+12:00| > 24.87| > > > +-----------------------------+---------------------------------------------+ > > > > Or as digital time; > > > > +----+---------------------------------------------+ > > > |Time|distinct_count(root.ln.wf01.wt01.temperature)| > > +----+---------------------------------------------+ > > | 20| 24.37| > > | 9| 24.12| > > | 16| 24.87| > > +----+---------------------------------------------+ > > > > > > Thanks > > Trevor Hart > > Ope Limited > > w: http://www.ope.nz/ > > m: +64212728039
