Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete future values #7798

Closed
robinsonjj opened this issue Jan 6, 2017 · 6 comments
Closed

Can't delete future values #7798

robinsonjj opened this issue Jan 6, 2017 · 6 comments

Comments

@robinsonjj
Copy link

I can't delete future values using either the "delete from where tag = ''" syntax or the "drop series where tag = ''" syntax.

I have also tried using a 'delete from ... where time > now())' but this doesn't seem to help either.

Thanks

@jwilder
Copy link
Contributor

jwilder commented Jan 6, 2017

We need more information in order to diagnose what is going on. Can you update the issue description with the instructions listed in our issue template?

@robinsonjj
Copy link
Author

Sure, sorry that was lazy of me.

I'm running version 1.1.0-1 on windows 7 and I'm using python to interact with influxdb:

starting out (printing length and earliest date):

In[317]: len(client.query("select * from forecasts_vd where id = 'ecphe_1_2'", database='db_v0.4')['forecasts_vd'])

Out[316]: 5403
In[318]: client.query("select * from forecasts_vd where id = 'ecphe_1_2'", database='db_v0.4')['forecasts_vd'].index.min()

Out[317]: Timestamp('2017-01-05 01:00:00+0000', tz='UTC')

running delete will delete past values but not future ones:

In[319]: client.query("delete from forecasts_vd where id = 'ecphe_1_2'", database='db_v0.4')

Out[318]: ResultSet({})
In[320]: len(client.query("select * from forecasts_vd where id = 'ecphe_1_2'", database='db_v0.4')['forecasts_vd'])

Out[319]: 5319
In[321]: client.query("select * from forecasts_vd where id = 'ecphe_1_2'", database='db_v0.4')['forecasts_vd'].index.min()

Out[320]: Timestamp('2017-01-06 17:00:00+0000', tz='UTC')

and the same output again if I use drop series. Let me know if I can provide any more information

@jwilder
Copy link
Contributor

jwilder commented Jan 6, 2017

You may need to explicitly set the upper time bound with something like:

... time < now() + 24h

The default end time defaults to now() still for deletes. For selects, it was changed in #7519. Looks like we need to fix deletes as well.

@jwilder
Copy link
Contributor

jwilder commented Jan 6, 2017

@jsternberg

@robinsonjj
Copy link
Author

That works, thanks!

@jwilder
Copy link
Contributor

jwilder commented May 12, 2017

Fixed via #8329

@jwilder jwilder closed this as completed May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants