Error: Filter by parent is required when applying any other filter

#1

Hi,

I am writing a fetch spec with a filter like so:

c3Grid(PointMeasurement.fetch({filter: “contains(parent,‘RCK157’)”, limit:20}))

And I get the error: “Filter by parent is required when applying any other filter”.

Can someone explain to me what the problem is?

Cheers

0 Likes

Traversing types with TimeseriesDataPoint
#2

Cassandra fetches can only be done for specific parent ids. You’ll probably need to get the exact parent ids first and then fetch the PointMeasurements with an intersects filter - something like “intersects(parent, [‘RCK157a’, ‘RCK157b’, …]”

1 Like

#3

Is there anything other than eq and intersect that can be used for filtering in Cassandra on the parent/header? We tried contains but it does not work.

We would like to fetch all PointMeasurement of all PointPhysicalMeasurementSeries of all MeterAsset (in field asset) with an id that contains a specific substring. This is to reduce the number of fetches as they are the bottleneck.

Thanks

0 Likes

#4

Cassandra does not do SQL-style search/filters on the partition keys themselves. You need to provide one or more specific keys, so the two options you listed are probably all you can do.

When dealing with a large number of series, MapReduce may end up being a faster option than running a massive fetch.

0 Likes