partitionKeyIsRequired error when processing a canonical mixing PhysicalMeasurementSeries



I have a problem I can’t figure out In the transform, I declare the start, end and two quantities for the measurement.
The measurement is remixing Measurement, in order to add another Ts field.
Here is Mesurement:

> @db(compactType=true,
>    datastore='cassandra',
>    partitionKeyField='parent',
>    persistenceOrder='start,end',
>    persistDuplicates=false,
>    shortId=true,
>    shortIdReservationRange=1000000)
> remix type Measurement {
>     @ts(treatment='rate')
>     quantity2: ExactDimension
> }

The PhysicalMeasurementSeries is as simple as it can, just remixing basic type and added some attributes.

The error processing the canonical is like

errorMsg: Global Exception:Partition key value is required for types with partition key field - type: Measurement provided id: null.c3.engine.database.DbException: Partition key value is required for types with partition key field - type: Measurement provided id: null. at c3.engine.database.DbException.

Many Thanks


In your Measurement transform you need to set the id of your parent (which is also the partitionKeyField). This will allow your measurement to be attached to the right PhysicalMeasurementSeries.

type TransformCanonicalMeasurementToMeasurement mixes Measurement transforms CanonicalMeasurement {
  parent:           ~ expression { id: "some_id_from_the_CanonicalMeasurement"}


I already declared parent in two different -transfer to measurement- types and the ID is indeed the same in there series each of each.

    id:  ~ expression "concat(servicePointId,'_kPCS','_5G',remoteMeasurement == 'L' ? '_R':'')"
    parent:  ~ expression "concat(servicePointId,'_kPCS','_5G',remoteMeasurement == 'L' ? '_R':'')"

  parent:           ~ expression "resource == '5G' && registerId == '0' ? ........."
  id :           ~ expression "resource == '5G' && registerId == '0' ? ........."


Can you look at your data, is there any chance that the resulting ID is null?
Also, prefer this annotation

parent: ~ expression {"id": "resource == '5G' && registerId == '0' ? ........."}


The ID can’t be null, knowing the injected Data, and the definition.
I will give it another try with your suggestion.


It didn’t help, furthermore, it returns a syntax error instead. at runtime.


May be you should try to test your transform but submitting chunks of this file and following this example Test Canonical Transform from console