2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

InfluxDBAdvent Calendar 2016

Day 16

DROP SERIESでも実はSERIESが残っている

Posted at

そんな気がする事象に出会いました。

influxdbで特定のdatabaseへ接続します。
(InfluxDBバージョン: 1.1.1)

> INSERT treasures,captain_id=pirate_king value=2
> SELECT * FROM treasures

name: treasures
time			captain_id	value
----			----------	-----
1481799497738729315	pirate_king	2

そして

> INSERT treasures,captain_id=pirate_king value="2"

ERR: {"error":"field type conflict: input field \"value\" on measurement \"treasures\" is type string, already exists as type float"}

型が違うということでエラーになります。ここまでは当然

> SHOW SERIES

key
---
treasures,captain_id=pirate_king

> DROP SERIES FROM treasures
> SHOW SERIES

で出力結果はなしです。

ただ、

> INSERT treasures,captain_id=pirate_king value="2"

ERR: {"error":"field type conflict: input field \"value\" on measurement \"treasures\" is type string, already exists as type float"}

why?

> SHOW SERIES

key
---
treasures,captain_id=pirate_king

しかし、SELECT * FROM treasures
何も出力されません。

該当のデータベースを削除して、作成し直すと
> INSERT treasures,captain_id=pirate_king value="2"
はもちろん成功します。

ただ今度は
> INSERT treasures,captain_id=pirate_king value=2

ERR: {"error":"field type conflict: input field \"value\" on measurement \"treasures\" is type float, already exists as type string"}

となります。

RETENTION POLICY

CREATE RETENTION POLICY test1 ON ga_batch DURATION 1s REPLICATION 1

ERR: retention policy duration must be at least 1h0m0s

ということですので、

> CREATE RETENTION POLICY test1 ON ga_batch DURATION 1h REPLICATION 1

でしばらく待ちます。

...
つづく

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?