【发布时间】:2023-03-12 09:20:01
【问题描述】:
我正在尝试使用 MarkLogics Optic API 让 Arithmetics 与聚合函数一起使用,但出现以下错误:
message=OPTIC-INVALARGS: fn.error(null, 'OPTIC-INVALARGS', -- Invalid arguments: right argument at 1 of op.multiply value must have xs.numeric datatype: op.count(op.col('count_42'), null)
我正在请求行端点:
POST http://marklogic:8000/LATEST/rows?database=SQLData HTTP/1.1
我正在尝试一个相当基本的查询,请参阅以下内容:
{
"$optic": {
"ns": "op",
"fn": "operators",
"args": [{
"ns": "op",
"fn": "from-view",
"args": [null, "employees", "e", null]
}, {
"ns": "op",
"fn": "select",
"args": [[{
"ns": "op",
"fn": "col",
"args": ["firstname"]
}, {
"ns": "op",
"fn": "col",
"args": ["lastname"]
}
], null]
}, {
"ns": "op",
"fn": "group-by",
"args": [[{
"ns": "op",
"fn": "col",
"args": ["firstname"]
}
], [{
"ns": "op",
"fn": "as",
"args": ["es", {
"ns": "op",
"fn": "multiply",
"args": [10, {
"ns": "op",
"fn": "count",
"args": ["count_42"]
}
]
}
]
}
]]
}
]
}
}
我不确定我做错了什么,或者端点不支持聚合算术。如果有人有线索,将不胜感激。
提前致谢。
【问题讨论】:
标签: marklogic