How to delete columns of a series in InfluxDB
Asked Answered
V

3

21

Is there any solution to remove a specific column of a series in InfluxDB?

Its seems that this feature is not implemented. But does anybody have found any kind of trick to do that?

Violist answered 5/11, 2014 at 21:8 Comment(1)
In case anyone wants a work around with influxdb 2 to avoid selecting some columns, it's called drop, see here: https://mcmap.net/q/661292/-what-is-the-equivalent-of-select-lt-certain-columns-gt-in-flux-query-languageCheshire
N
12

There is no way to delete a "column" (i.e. a field or a tag) from an Influx measurement. Here's the feature request for that.

You'll have to SELECT INTO a different measurement, excluding the columns you don't want:

SELECT useful_field, nice_tag INTO new_measurement FROM measurement
Nanine answered 26/9, 2016 at 2:24 Comment(0)
Z
0

I know this question is a bit stale, but Influx still does not have this feature. We can only speculate about why not.

As I mentioned in this question, though, since Influx just uses binary files for data and metadata you "just" have to figure out the formatting to edit these files. Luckily, it seems some people have already done this for you. In my search, I found Infix, from ABC Arbitrage, which provides a command-line tool to rename, remove, and modify columns on Influx database files. The drawback is that it requires stopping the Influx service, so if you have a system that is not tolerant of downtime, you may still be out of luck.

Zsolway answered 24/4, 2023 at 14:53 Comment(0)
A
-3

Probably too late, but you can use

USE table_name, DROP SERIES FROM "my_column_name"

https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/#drop-series-from-the-index-with-drop-series

Archpriest answered 14/6, 2021 at 8:17 Comment(1)
This does not work. DROP SERIES FROM expects a measurement name, not a field key.Flunky

© 2022 - 2024 — McMap. All rights reserved.