Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix JDBC response for delete query #337

Merged
merged 6 commits into from Jan 13, 2020

Conversation

abbashus
Copy link
Contributor

@abbashus abbashus commented Jan 8, 2020

Issue: #131

Description of changes:
Fixes the JDBC output format of delete query

Previously

==== _opendistro/_sql?_format=jdbc ====
{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "class com.amazon.opendistroforelasticsearch.sql.domain.Delete cannot be cast to class com.amazon.opendistroforelasticsearch.sql.domain.Select (com.amazon.opendistroforelasticsearch.sql.domain.Delete and com.amazon.opendistroforelasticsearch.sql.domain.Select are in unnamed module of loader java.net.FactoryURLClassLoader @46963479)",
    "type": "ClassCastException"
  },
  "status": 500
}

Now

{
  "schema": [{
    "name": "deleted_rows",
    "type": "long"
  }],
  "total": 1,
  "datarows": [[1]],
  "size": 1,
  "status": 200
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Member

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Copy link
Contributor

@davidcui1225 davidcui1225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abbashus abbashus merged commit 31f8624 into opendistro-for-elasticsearch:master Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants