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

Support INSERT statements in SQL #1

Open
MaxKsyunz opened this issue Jul 27, 2022 · 2 comments
Open

Support INSERT statements in SQL #1

MaxKsyunz opened this issue Jul 27, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@MaxKsyunz
Copy link
Owner

As an SQL user I would like to create documents using INSERT statements.

Sample

INSERT INTO MV_A(FieldA, FieldB, FieldC) VALUES (1, "two", 3.0f)

References

@MaxKsyunz MaxKsyunz added the enhancement New feature or request label Jul 27, 2022
@MaxKsyunz MaxKsyunz self-assigned this Jul 27, 2022
@MaxKsyunz MaxKsyunz moved this to Researching 🔎 in @MaxKsyunz's OpenSearch Pet Issues Jul 27, 2022
@MaxKsyunz
Copy link
Owner Author

MaxKsyunz commented Jul 27, 2022

In OpenSearch, 'insert' (a.k.a. indexing) is done like so:

PUT sample-index/_doc/1
{
  "Description": "To be or not to be, that is the question."
}

Response looks like this

{
  "_index": "sample-index",
  "_id": "1",
  "_version": 1,
  "result": "created",
  "_shards": {
    "total": 2,
    "successful": 1,
    "failed": 0
  },
  "_seq_no": 0,
  "_primary_term": 1
}
  • Should any of this data be returned in SQL plugin response?

@MaxKsyunz
Copy link
Owner Author

When the user sets _id for the new document -- INSERT INTO table (_id, ...) VALUES (1, ...)
and the document already exists
then SQL plugin returns an error response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Researching 🔎
Development

No branches or pull requests

1 participant