3

In order to upsert records in timestream, the version number of the new record should be higher than that of the existing record. But I have not been able to find a way to get the existing record's version. Version is not returned in the AWS console. It is also not returned when querying programmatically.

How can I get the current version of a record ?

ninsonTan
  • 361
  • 1
  • 2
  • 17
  • I also needed the same. It has sense that if you write something you need to be able to read it. At least that the version is never written into the database but just used to de-duplicate records that you enter in a batch process. I mean one way to simplify the operations if you write 100 records at once and two of them are different version of the same record. – yucer Jan 25 '22 at 18:03
  • 1
    I contacted aws support, and what they bascially said was to use something like the current unix time in ms for the version number. that approach is even in their docs. But yes it is still quite weird how you can not get the version number. – ninsonTan Jan 25 '22 at 19:25
  • The best usage for Version fields is to store an Epoch Timestamp on it. In this way, you don't need to retrieve the current version to bump it. You just write a higher Epoch Timestamp and it's done. – Eduardo Elias Saléh Jan 27 '22 at 14:14
  • Did AWS support give you any other information than that? I don't see how epoch timestamp is relevant to this question at all (in the title, forget about upsert for a moment). Regardless of whether I am using epoch, incrementing an integer, or picking a random number, I would like a way to be able to see what the current version number is and ideally also view previous versions. – Jake Jul 26 '23 at 14:39

0 Answers0