JsonAPI的查表时,一次只能取1024条记录

var code = "select * from table(1..2000 as id)";
        code = encodeURIComponent(code);
        var paramJson = {
            "sessionID": "0",
            "functionName": "executeCode",
            "params": [{
                "name": "script",
                "form": "scalar",
                "type": "string",
                "value": code
            }]
        };
        var option = {
                url: "http://localhost:8848",
                async: true,
                data: JSON.stringify(paramJson),
                type: "POST",
                dataType: "json",
                success: function (data) {
                    var resultJson = data; //data={...}
                    console.log(resultJson);
                }
            }
        $.ajax(option);


请先 登录 后评论

1 个回答

Yingnan Wang

需要设置length参数

var paramJson = {
            "sessionID": "0",
            "functionName": "executeCode",
            "length":2000,
            "params": [{
                "name": "script",
                "form": "scalar",
                "type": "string",
                "value": code
            }]
        };

这里length最大设置为100000,即单次查询最多返回10W记录

请先 登录 后评论