Remove the measurement fragment and series from the Database

What product/components do you use and which version/fix level are you on?

latest

Is your question related to the free trial, or to a production (customer) instance?

production

What are you trying to achieve? Please describe it in detail.

I would like to remove the measurement fragment and series from the DB of the specific day.

Do you get any error messages? Please provide a full error message screenshot and log file.

Have you installed all the latest fixes for the products and systems you are using?

latest.

Hey,

each measurement has the following structure:

{
  "fragment1": {
    "series1": {
      "value": 42
    }
  },
  "fragment2": {
    "series1": {
      "value": 43
    }
  },
  "source": {
    "id": "161705401"
  },
  "time": "2023-02-28T15:15:17.165127+01:00",
  "type": "someType"
}

So each measurement can have multiple fragments and series.

Do you want to:
a) delete all measurements of a certain day
b) delete all measurements of above type from a certain day
c) delete e.g. “fragment1” from existing measurement but keep “fragment2” from a certain day
d) something else?

C)Delete series from fragment1 from existing measurement of a certain day.

Unlike the other domain objects, Measurements are immutable. So once they are created you cannot update them anymore by design.

If this is really needed, the only way I could think of is to write a script that:

  • GETs the measurements (e.g. dump in a file)
  • Update them locally
  • Delete them in the platform
  • Recreate them from local file
2 Likes

I don’t want to update the series but delete entire series value along with series name.
Example : I want to delete entire series value and also key from the fragment

Present
{
“fragment1”: {
“series1”: {
“value”: 42
}
“series2”{
“value”: 45
},
“source”: {
“id”: “161705401”
},
“time”: “2023-02-28T15:15:17.165127+01:00”,
“type”: “someType”
}

Expected after delete:
{
“fragment1”: {
“series2”{
“value”: 45
},
“source”: {
“id”: “161705401”
},
“time”: “2023-02-28T15:15:17.165127+01:00”,
“type”: “someType”
}

Yes, same situation. You cannot change the content of a measurement document anymore once it is created - so both applies: you cannot “update” the content, nor delete parts of it.

Is there any query where I can delete the fragments key value pairs for the entire day?

There are queries to:

  • delete all measurements of an entire day
  • delete all measurements of a certain type of an entire day (referring to the type attribute in each measurement)
  • delete all measurements containing a certain fragment and/or certain series of an entire day

…but they all result in deleting the corresponding measurements completely (including all fragments and series it has!)

There are no queries to:

  • delete parts of a measurement (e.g. a certain fragment or series) from existing measurement documents. This could only be achieved by the four steps posted above (export measurements, remove the faulty fragment locally, delete and recreate them in platform)

// Keep in mind if you are using Datahub: deleting and recreating measurements could have side effects on your Data Lake Offloading.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.