I am using IoTDB, a time-series database, to store data from various vehicles. Each vehicle has multiple properties such as charge_level, speed, temperature, location, etc., stored in separate time series under the path root.vehicle.<vehicle_id>. I want to update the charge_level property for a specific vehicle while retaining all other properties' previous values. I tried using the following INSERT statement:
INSERT INTO root.vehicle.ENTMLCSAF21287542
(timestamp, charge_level)
VALUES ('2023-08-03T16:12:26.755+05:30', 777);
However, this sets null for all other properties in the new data point at that point of time.
Is there a way to construct the INSERT statement dynamically, fetching the schema for the specific time series, so that I can use the LAST function to retain the previous values of other properties?
I would appreciate any insights or examples on how to achieve this programmatically, This can be done by fetching the previous value and copying it. But that does not seems to be a optimal approach. So, can you please suggest some way.