このようなDruidネイティブクエリでgroupby仮想列を実行しようとしています...
{
"queryType": "groupBy",
"dataSource": "trace_info",
"granularity": "none",
"virtualColumns": [
{
"type": "expression",
"name": "tenant",
"expression": "replace(array_offset(tags, array_offset_of(tagNames, 'tenant')), 'tenant:', '')"
},
{
"type": "expression",
"name": "rc",
"expression": "replace(array_offset(tags, array_offset_of(tagNames, 'row_count')), 'row_count:', '')"
}
],
"dimensions": [
"tenant"
],
"aggregations": [
{
"type": "longSum",
"name": "trc",
"fieldName": "rc"
}
],
...
...
...
"intervals": [
"..."
]
}
これにより、groupBy 列が null であるかのように、すべての row_counts の longsum を持つ単一の行が得られます。
私の使い方は正しいですか、それともこれは Druid の既知の問題ですか? ドキュメントには、仮想列は通常のディメンションのように使用できると書かれていますが、実際の例が欠落している方法やさらには不明です。
ありがとう!パニ