Upsert additional measure values to an existing multi measure record

0

I have a use case where I receive measures relating to the same dimension/timestamp at different times. I've previously been storing these as discrete records, but I'd prefer to have the initial record supplemented with the additional values.

For example, my data source produces records that looks like device, timestamp, sensorId, metric and I'd like to represent this in timestream as:

device, timestamp, S1metric, S2metric, S3metric

NB: The sensorId's are in the range 1-3.

This means creating a partial record and updating the values over time as new data is received for the same dimensions.

When I receive the first data point, the record would be

<device>, <timestamp>, S1metric=<s1value>

When I receive the second data point, the record would be written as

<device>, <timestamp>, S1metric=<s2value>

And I want the stored record to look like:

<device>, <timestamp>, S1metric=<s1value>, s2metric=<s2value>

If I do an upsert with a Version set to Date.now() (Javascript) then the second record completely replaces the first, as opposed to adding the new value where there was previously NULL. I do not specify NULL for the missing values in the write request, I simply specify the measure value for the sensor I'm currently handling. I was hoping that TS would use the already stored value for the values not specified in the write request, but the update seems to be processed as a whole record (which I can provide without first querying the existing record).

Is there a way to acheive what I'm trying to do?

질문됨 일 년 전90회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠