From 198a6f72a5f82e09f6e2efffa097dff987c5c70d Mon Sep 17 00:00:00 2001 From: Jiyong Huang Date: Tue, 6 Sep 2022 12:01:36 +0800 Subject: [PATCH] config(graph): add op node json desc Signed-off-by: Jiyong Huang --- etc/ops/filter.json | 52 ++++++++++++++ etc/ops/function.json | 52 ++++++++++++++ etc/ops/groupby.json | 52 ++++++++++++++ etc/ops/join.json | 119 ++++++++++++++++++++++++++++++++ etc/ops/orderby.json | 83 ++++++++++++++++++++++ etc/ops/pick.json | 52 ++++++++++++++ etc/ops/window.json | 110 +++++++++++++++++++++++++++++ test/graph_group_order_rule.jmx | 2 +- 8 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 etc/ops/filter.json create mode 100644 etc/ops/function.json create mode 100644 etc/ops/groupby.json create mode 100644 etc/ops/join.json create mode 100644 etc/ops/orderby.json create mode 100644 etc/ops/pick.json create mode 100644 etc/ops/window.json diff --git a/etc/ops/filter.json b/etc/ops/filter.json new file mode 100644 index 0000000000..dc0706eee5 --- /dev/null +++ b/etc/ops/filter.json @@ -0,0 +1,52 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to filter out rows based on a filter condition.", + "zh_CN": "用于过滤数据流的操作" + } + }, + "properties": [{ + "name": "expr", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "filter condition expression", + "zh_CN": "过滤条件语句" + }, + "label": { + "en_US": "Condition", + "zh_CN": "条件" + } + }], + "node": { + "display": true, + "category": "op", + "input": { + "type": "any", + "rowType": "any", + "collectionType": "any" + }, + "output": { + "type": "same", + "strategy": "keep" + }, + "icon": "iconPath", + "label": { + "en": "Filter", + "zh": "过滤" + } + } +} \ No newline at end of file diff --git a/etc/ops/function.json b/etc/ops/function.json new file mode 100644 index 0000000000..e8dce08b8b --- /dev/null +++ b/etc/ops/function.json @@ -0,0 +1,52 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to invoke a function", + "zh_CN": "用于调用函数的操作" + } + }, + "properties": [{ + "name": "expr", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "Function call expression", + "zh_CN": "函数调用语句" + }, + "label": { + "en_US": "Expression", + "zh_CN": "函数语句" + } + }], + "node": { + "display": false, + "category": "op", + "input": { + "type": "any", + "rowType": "any", + "collectionType": "single" + }, + "output": { + "type": "same", + "strategy": "append" + }, + "icon": "iconPath", + "label": { + "en": "Function", + "zh": "函数" + } + } +} \ No newline at end of file diff --git a/etc/ops/groupby.json b/etc/ops/groupby.json new file mode 100644 index 0000000000..d2e648d2d5 --- /dev/null +++ b/etc/ops/groupby.json @@ -0,0 +1,52 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to group the events by the condition.", + "zh_CN": "用于按条件对事件进行分组的操作。" + } + }, + "properties": [{ + "name": "dimensions", + "default": "[]", + "optional": false, + "control": "text", + "type": "list_string", + "hint": { + "en_US": "the dimension fields to group by", + "zh_CN": "分组的维度字段" + }, + "label": { + "en_US": "Dimensions", + "zh_CN": "维度" + } + }], + "node": { + "display": true, + "category": "op", + "input": { + "type": "collection", + "rowType": "single", + "collectionType": "any" + }, + "output": { + "type": "collection", + "strategy": "grouped" + }, + "icon": "iconPath", + "label": { + "en": "Group By", + "zh": "分组" + } + } +} \ No newline at end of file diff --git a/etc/ops/join.json b/etc/ops/join.json new file mode 100644 index 0000000000..b632264217 --- /dev/null +++ b/etc/ops/join.json @@ -0,0 +1,119 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to combine rows from two or more tables, based on a related column between them.", + "zh_CN": "用于基于两个或多个表之间的相关列连接行的操作。" + } + }, + "properties": [{ + "name": "from", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "From table name", + "zh_CN": "来源表的名字" + }, + "label": { + "en_US": "From", + "zh_CN": "来源表" + } + },{ + "name": "joins", + "optional": false, + "control": "list", + "type": "list_object", + "hint": { + "en_US": "Join conditions", + "zh_CN": "连接条件" + }, + "label": { + "en_US": "Joins", + "zh_CN": "连接" + }, + "default": [ + { + "name": "name", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "Join table name", + "zh_CN": "连接的表名" + }, + "label": { + "en_US": "Table Name", + "zh_CN": "表名" + } + }, + { + "name": "type", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "values": [ + "inner", + "left", + "right", + "full", + "cross" + ], + "hint": { + "en_US": "Join type", + "zh_CN": "连接类型" + }, + "label": { + "en_US": "Type", + "zh_CN": "类型" + } + }, + { + "name": "on", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "join condition expression", + "zh_CN": "连接条件语句" + }, + "label": { + "en_US": "Condition", + "zh_CN": "条件" + } + } + ] + }], + "node": { + "display": true, + "category": "op", + "input": { + "type": "collection", + "rowType": "single", + "collectionType": "single" + }, + "output": { + "type": "collection", + "strategy": "append" + }, + "icon": "iconPath", + "label": { + "en": "Join", + "zh": "连接" + } + } +} \ No newline at end of file diff --git a/etc/ops/orderby.json b/etc/ops/orderby.json new file mode 100644 index 0000000000..9f8d57f19b --- /dev/null +++ b/etc/ops/orderby.json @@ -0,0 +1,83 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to order the rows.", + "zh_CN": "用于排序的操作" + } + }, + "properties": [{ + "name": "sorts", + "optional": false, + "control": "list", + "type": "list_object", + "hint": { + "en_US": "order expression", + "zh_CN": "排序语句" + }, + "label": { + "en_US": "Order", + "zh_CN": "排序" + }, + "default": [ + { + "name": "field", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "hint": { + "en_US": "Order by field", + "zh_CN": "用于排序的字段名" + }, + "label": { + "en_US": "Field", + "zh_CN": "字段" + } + }, + { + "name": "order", + "default": false, + "optional": false, + "control": "checkbox", + "type": "boolean", + "hint": { + "en_US": "Order by descending", + "zh_CN": "是否降序" + }, + "label": { + "en_US": "Descending", + "zh_CN": "降序" + } + } + ] + }], + "node": { + "display": true, + "category": "op", + "input": { + "type": "any", + "rowType": "any", + "collectionType": "any" + }, + "output": { + "type": "same", + "strategy": "keep" + }, + "icon": "iconPath", + "label": { + "en": "Filter", + "zh": "过滤" + } + } +} \ No newline at end of file diff --git a/etc/ops/pick.json b/etc/ops/pick.json new file mode 100644 index 0000000000..1ddd694f2d --- /dev/null +++ b/etc/ops/pick.json @@ -0,0 +1,52 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to pick the selected fields.", + "zh_CN": "用于选取字段的操作" + } + }, + "properties": [{ + "name": "fields", + "default": "", + "optional": false, + "control": "text", + "type": "list_string", + "hint": { + "en_US": "select fields", + "zh_CN": "选取字段" + }, + "label": { + "en_US": "Fields", + "zh_CN": "字段" + } + }], + "node": { + "display": true, + "category": "op", + "input": { + "type": "any", + "rowType": "any", + "collectionType": "any" + }, + "output": { + "type": "same", + "strategy": "pick" + }, + "icon": "iconPath", + "label": { + "en": "Pick", + "zh": "选择" + } + } +} \ No newline at end of file diff --git a/etc/ops/window.json b/etc/ops/window.json new file mode 100644 index 0000000000..1e6c246c41 --- /dev/null +++ b/etc/ops/window.json @@ -0,0 +1,110 @@ +{ + "about": { + "trial": false, + "author": { + "name": "EMQ", + "email": "contact@emqx.io", + "company": "EMQ Technologies Co., Ltd", + "website": "https://www.emqx.io" + }, + "helpUrl": { + "en_US": "https://github.com/lf-edge/ekuiper/blob/master/docs/en_US/sqls/query_language_elements.md", + "zh_CN": "https://github.com/lf-edge/ekuiper/blob/master/docs/zh_CN/sqls/query_language_elements.md" + }, + "description": { + "en_US": "An operation to create a streaming window", + "zh_CN": "用于创建窗口的操作" + } + }, + "properties": [ + { + "name": "type", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "values": [ + "tumblingwindow", + "hoppingwindow", + "slidingwindow", + "sessionwindow", + "countwindow" + ], + "hint": { + "en_US": "window type", + "zh_CN": "窗口类型" + }, + "label": { + "en_US": "Window Type", + "zh_CN": "窗口类型" + } + },{ + "name": "unit", + "default": "", + "optional": false, + "control": "text", + "type": "string", + "values": [ + "ms", + "ss", + "mi", + "hh", + "dd" + ], + "hint": { + "en_US": "Time unit for the window", + "zh_CN": "窗口的时间单位" + }, + "label": { + "en_US": "Time Unit", + "zh_CN": "时间单位" + } + },{ + "name": "size", + "default": "", + "optional": false, + "control": "text", + "type": "int", + "hint": { + "en_US": "Window Length", + "zh_CN": "窗口长度" + }, + "label": { + "en_US": "Window Length", + "zh_CN": "窗口长度" + } + },{ + "name": "interval", + "default": "", + "optional": false, + "control": "text", + "type": "int", + "hint": { + "en_US": "Window trigger interval", + "zh_CN": "窗口触发周期" + }, + "label": { + "en_US": "Window Trigger Interval", + "zh_CN": "窗口触发周期" + } + }], + "node": { + "display": false, + "category": "op", + "input": { + "type": "row", + "rowType": "any", + "collectionType": "any", + "allowMulti": true + }, + "output": { + "type": "collection", + "strategy": "append" + }, + "icon": "iconPath", + "label": { + "en": "Window", + "zh": "窗口" + } + } +} \ No newline at end of file diff --git a/test/graph_group_order_rule.jmx b/test/graph_group_order_rule.jmx index 097524f503..4c339ce1cf 100644 --- a/test/graph_group_order_rule.jmx +++ b/test/graph_group_order_rule.jmx @@ -190,7 +190,7 @@ "props": { "sorts": [{ "field": "count", - "desc": false + "desc": true }] } },