sql icon indicating copy to clipboard operation
sql copied to clipboard

[BUG] Delete query in query workbench returns 0 lines deleted while select returns multiple lines

Open drBenway opened this issue 2 years ago • 1 comments

Describe the bug

GIVEN, I go the the query workbench AND I run the select query

select * from filebeat-prodapps-2022.10.04 
where container.labels.io_kubernetes_pod_namespace = "xyz"

AND this query gives me multiple results image THEN I expect that the delete query

delete from filebeat-prodapps-2022.10.04 
where container.labels.io_kubernetes_pod_namespace = "xyz"

to delete multiple entries. This is however not the case

image

To Reproduce Steps to reproduce the behavior:

  1. Go to query workbench
  2. run a select query like the one above
  3. you should get back multiple results
  4. change the select * to delete
  5. you likely get an error stating that the query is wrong. This could be because delete is turned off by default
  6. if its turned off run PUT _plugins/_query/settings { "transient": { "plugins.sql.delete.enabled": "true" } }
  7. try again. I expect you get a result like the image above. I tested this with 2 different indexes with the same fields

Expected behavior I expect to get back a delete success with a number of lines that got deleted

OpenSearch Version I'm running opensearch/dashboards version 2.3.0 via docker compose.

Dashboards Version 2.3.0

Plugins

security, alerting, ML, everyting from the default docker compose

Host/Environment (please complete the following information):

  • Ubuntu 20.04
  • Firefox 105.0.2

drBenway avatar Oct 05 '22 13:10 drBenway

@drBenway Thanks for reporting the issue! Will investigate based on the info you provided.

dai-chen avatar Oct 06 '22 16:10 dai-chen