You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/22 06:46:21 UTC

[GitHub] [incubator-doris] wangqiuhao0912 opened a new pull request #7459: add iot-function to doris

wangqiuhao0912 opened a new pull request #7459:
URL: https://github.com/apache/incubator-doris/pull/7459


   Create function SQL as follows:
   
   drop FUNCTION udaf_iot_first(BIGINT,DOUBLE);
   CREATE AGGREGATE FUNCTION udaf_iot_first(BIGINT,DOUBLE) RETURNS DOUBLE
   PROPERTIES (
   "init_fn"="_ZN9doris_udf12IotFunctions18init_iot_functionsEPNS_15FunctionContextEPNS_9StringValE",
   "update_fn"="_ZN9doris_udf12IotFunctions16iot_first_updateEPNS_15FunctionContextERKNS_9BigIntValERKNS_9DoubleValEPNS_9StringValE",
   "merge_fn"="_ZN9doris_udf12IotFunctions15iot_first_mergeEPNS_15FunctionContextERKNS_9StringValEPS3_",
   "serialize_fn"="_ZN9doris_udf12IotFunctions9serializeEPNS_15FunctionContextERKNS_9StringValE",
   "finalize_fn"="_ZN9doris_udf12IotFunctions8finalizeEPNS_15FunctionContextERKNS_9StringValE",
   "object_file"="http://IP/../libudaf_iot_algorithm.so" );


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] wangqiuhao0912 commented on pull request #7459: add iot-function to doris

Posted by GitBox <gi...@apache.org>.
wangqiuhao0912 commented on pull request #7459:
URL: https://github.com/apache/incubator-doris/pull/7459#issuecomment-1000392464


   @morningman 
   
   In fact, the meaning of this function is very simple, that is, to find the code1 corresponding to the smallest timestamp (ts) in this group, which will often be used in IoT data. For example, the two rows of data are as follows:
   equipment     ts                code1
   equ_a     1640274843000  1.1
   equ_a     1640274844000  2.5
   Using udaf-iot-first(ts, code1) is 1.1, similar to first_value over(), but it is an aggregation within a group


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #7459: add iot-function to doris

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #7459:
URL: https://github.com/apache/incubator-doris/pull/7459#issuecomment-1000387649


   > udaf_iot_first
   
   Sorry, I want to know the behavior of this udaf.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] wangqiuhao0912 commented on pull request #7459: add iot-function to doris

Posted by GitBox <gi...@apache.org>.
wangqiuhao0912 commented on pull request #7459:
URL: https://github.com/apache/incubator-doris/pull/7459#issuecomment-1000087551


   > Hi @wangqiuhao0912 , could you give an example of this function's usage?
   
   
   Hi @morningman ,this is create table sql  and usage:
   
   create table equipment_no_par(equipment varchar(32),
   ts bigint,
   code1 double)
   UNIQUE KEY(`equipment`,`ts`)
   DISTRIBUTED BY HASH(equipment) buckets 1;
   
   select equipment,udaf_iot_first(ts,code1) from equipment_no_par group by equipment;
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #7459: add iot-function to doris

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #7459:
URL: https://github.com/apache/incubator-doris/pull/7459#issuecomment-1000054869


   Hi @wangqiuhao0912 , could you give an example of this function's usage?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org