5. SQL工具

参考JSON

多个输入,单个输出 在调用此接口之前,前端应先设计动作调用上传资源的接口 :doc:`上传SQL工具<../api/ispatial-compute/machinelearning/uploadSQL>`,将用户所编写的SQL脚本作为资源上传

## 参数

名称 | 类型 | 是否必传 | 备注 |
——– | —– | —- | ——|
inputarg | array | Y | 字段集合 |
inputarg.#.tbname1 | string | N | 表名,为空填写”” |
inputarg.#.tbname2 | string | N | 表名,为空填写”” |
inputarg.#.tbname3 | string | N | 表名,为空填写”” |
inputarg.#.tbname4 | string | N | 表名,为空填写”” |

## 返回

名称 | 类型 | 是否必传 | 备注 |
——– | —– | —- | ——|
result | String | Y | 所有输出的JSON,按节点类型解析 |

## 算法入口及参数

暂不支持单独调用

5.1. # 配置模版:SQL工具

#### type: 105

{
    "label": "SQL工具",
    "name": "split",
    "params": {
        "input_nodes": [
            {
                "key": "tbname1",
                "desc": "输入数据表",
                "type": "table"
            },
            {
                "key": "tbname2",
                "desc": "输入数据表",
                "type": "table"
            },
            {
                "key": "tbname3",
                "desc": "输入数据表",
                "type": "table"
            },
            {
                "key": "tbname4",
                "desc": "输入数据表",
                "type": "table"
            }
        ],
        "input_form": [
            {
                "key": "sqltext",
                "label": "SQL脚本",
                "placeholder": "--输入数据已自动映射成t1~t4,使用方式如:select * from ${t1}",
                "default": "select * from ${t1};select * from ${t1};",
                "type": "textarea"
            },
            {
                "text": "保存脚本",
                "type": "button",
                "func": "saveSql"
            }
        ],
        "output_nodes": [
            {
                "key": "output1",
                "desc": "输出数据表",
                "type": "table"
            }
        ]
    }
}