option task = {name: “grp_viewtime_1m”, every: 1m}
from(bucket: “local_qos_acs”)
|> range(start: -task.every)
|> filter(fn: (r) => r._measurement == “viewtime”)
|> filter(fn: (r) => r._field == “Ttime” or r._field == “count” or r._field == “listSize”)
|> aggregateWindow(every: 1m, fn: sum)
|> map(
fn: (r) =>
({r with modifiedTime: r._Ttime, modifiedCount: r._count, modifiedSize: r._listSize}),
)
|> group(columns: [“_time”, “prd”, “viewtype”])
|> set(key: “_measurement”, value: “grp_viewtime_1m”)
|> to(bucket: “local_acs”, org: “media”)
Whenever the above task is executed, the aggregate result could not rename (modifiedTime: r._Ttime, modifiedCount: r._count, modifiedSize: r._listSize)