Error when querying with REST API(sum function)

When I query with sum function with REST API, I get the following error.
And I tried this flux code with vscode exteion, work well.

from(bucket: “sample”)
|> range(start: 2023-05-16T00:00:00Z, stop: 2023-05-17T00:00:00Z)
|> filter(fn: (r) => r._measurement == “sample” and r.event_id == “110” and exists r.name)
|> group(columns: [“room_id”, “name”])
|> sum()
|> yield()

CollectRows ERROR HttpError: Error creating group plans for namespace ‘e2f664242ee5686c_8d8038108d71abad’: read_group: gRPC planner got error building plan: Error during planning: The function Sum does not support inputs of type Utf8.
caused by
Error during planning: The function Sum does not support inputs of type Utf8.
at L.throwOnErrorResponse (FetchTransport.ts:164:1)
at async FetchTransport.ts:100:1

If I use the aggregateWindow function as below, it works normally, but I want to get the sum over the entire period.

aggregateWindow(every: 1d, fn: sum, column: "_value")

Please advice to solve this problem.
Thanks

I used influxdb cloud version.
Does anyone else have the same problem as me?

Hello @cer718,
That’s odd. So just to verify,

from(bucket: “sample”)
|> range(start: 2023-05-16T00:00:00Z, stop: 2023-05-17T00:00:00Z)
|> filter(fn: (r) => r._measurement == “sample” and r.event_id == “110” and exists r.name)
|> group(columns: [“room_id”, “name”])
|> aggregateWindow(every: 1d, fn: sum, column: "_value")
|> yield()

Works?

It’s possible you have data of a different types or strings that can’t be summed?
Try converting all data to floats.
And try filtering out data that isn’t float?

I hope that helps and you have a good day :slight_smile: