chenlinzhong commented on code in PR #11761: URL: https://github.com/apache/doris/pull/11761#discussion_r945408087
########## samples/doris-demo/remote-udaf-cpp-demo/README.md: ########## @@ -25,4 +25,132 @@ under the License. # Run `./function_server 9000` -`9000` is the port that the server will listen on \ No newline at end of file +`9000` is the port that the server will listen on + + +# Demo + +``` +//create one table such as table2 +CREATE TABLE `table2` ( + `event_day` date NULL, + `siteid` int(11) NULL DEFAULT "10", + `citycode` smallint(6) NULL, + `visitinfo` varchar(1024) NULL DEFAULT "", + `pv` varchar(1024) REPLACE NULL DEFAULT "0" +) ENGINE=OLAP +AGGREGATE KEY(`event_day`, `siteid`, `citycode`, `visitinfo`) +COMMENT 'OLAP' +DISTRIBUTED BY HASH(`siteid`) BUCKETS 10 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) +//import some data +MySQL [test_db]> select * from table2; ++------------+--------+----------+------------------------------------+------+ +| event_day | siteid | citycode | visitinfo | pv | ++------------+--------+----------+------------------------------------+------+ +| 2017-07-03 | 8 | 12 | {"ip":"192.168.0.5","source":"pc"} | 81 | +| 2017-07-03 | 37 | 12 | {"ip":"192.168.0.3","source":"pc"} | 81 | +| 2017-07-03 | 67 | 16 | {"ip":"192.168.0.2","source":"pc"} | 79 | +| 2017-07-03 | 101 | 11 | {"ip":"192.168.0.5","source":"pc"} | 65 | +| 2017-07-03 | 32 | 15 | {"ip":"192.168.0.1","source":"pc"} | 188 | +| 2017-07-03 | 103 | 12 | {"ip":"192.168.0.5","source":"pc"} | 123 | +| 2017-07-03 | 104 | 16 | {"ip":"192.168.0.5","source":"pc"} | 79 | +| 2017-07-03 | 3 | 12 | {"ip":"192.168.0.3","source":"pc"} | 123 | +| 2017-07-03 | 3 | 15 | {"ip":"192.168.0.2","source":"pc"} | 188 | +| 2017-07-03 | 13 | 11 | {"ip":"192.168.0.1","source":"pc"} | 65 | +| 2017-07-03 | 53 | 12 | {"ip":"192.168.0.2","source":"pc"} | 123 | +| 2017-07-03 | 1 | 11 | {"ip":"192.168.0.1","source":"pc"} | 65 | +| 2017-07-03 | 7 | 16 | {"ip":"192.168.0.4","source":"pc"} | 79 | +| 2017-07-03 | 102 | 15 | {"ip":"192.168.0.5","source":"pc"} | 188 | +| 2017-07-03 | 105 | 12 | {"ip":"192.168.0.5","source":"pc"} | 81 | ++------------+--------+----------+------------------------------------+------+ +``` + +### 1. find most visit top 3 ip +c++ demo not implement,If you are interested you can reference java/python demo Review Comment: > remove this? ok ,done -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org