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

SQL: binary communication implementation for drivers and the CLI #48261

Merged
merged 12 commits into from
Oct 31, 2019

Conversation

astefan
Copy link
Contributor

@astefan astefan commented Oct 18, 2019

This PR adds binary (CBOR) communication between server and drivers (JDBC/ODBC) and, also, the CLI. It, also, introduces a request parameter - binary - with debugging purposes to disable the binary response and get back to JSON text format when needed. But, by default, when the parameter is not specifically set, the behavior is to encode the response in CBOR format.

Implementation for #47785.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

Nice work! Left some comments though, but for some maybe I'm just confused.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM

@bpintea
Copy link
Contributor

bpintea commented Oct 22, 2019

Shouldn't the 7.x label be 7.6.0?

@matriv
Copy link
Contributor

matriv commented Oct 22, 2019

Shouldn't the 7.x label be 7.6.0?

I think so, 7.5.0 has already a build candidate:
https://github.com/elastic/dev/issues/1283

@astefan astefan changed the title SQL: binary response implementation for drivers and the CLI SQL: binary communication implementation for drivers and the CLI Oct 24, 2019
@astefan astefan requested review from bpintea and matriv October 24, 2019 09:13
@astefan astefan added v7.6.0 and removed v7.5.0 labels Oct 24, 2019
Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

Great work @astefan! And really nice testing!
I left some comments, most very minor. I'm a bit concerned about this though: https://github.com/elastic/elasticsearch/pull/48261/files#diff-fceb0a242e81eb82e7a233209889929fR65 if you could take another look.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

LGTM!! Great work!

@astefan
Copy link
Contributor Author

astefan commented Oct 24, 2019

@elasticmachine run elasticsearch-ci/1

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM. The only concern I have is around the parameter name - binary is fairly vague and I would give it some more context (binary protocol, binary encoding,etc...).

@@ -34,21 +34,25 @@
static final ParseField COLUMNAR = new ParseField("columnar");
static final ParseField FIELD_MULTI_VALUE_LENIENCY = new ParseField("field_multi_value_leniency");
static final ParseField INDEX_INCLUDE_FROZEN = new ParseField("index_include_frozen");

static final ParseField BINARY_COMMUNICATION = new ParseField("binary");
Copy link
Member

Choose a reason for hiding this comment

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

I find "binary" confusing - how about binary_format or binary_protocol?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

binary_format it is, I'll change it.

* See {@code SqlTranslateRequest.toXContent}
*/
private Boolean columnar = Boolean.FALSE;
private Boolean binaryCommunication = null;
Copy link
Member

Choose a reason for hiding this comment

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

Move the defaults in the Protocol class as the other classes (same for columnar).

@astefan astefan merged commit f96a5ca into elastic:master Oct 31, 2019
@astefan astefan deleted the 47785_impl branch October 31, 2019 21:45
astefan added a commit that referenced this pull request Nov 1, 2019
)

* Introduce binary_format request parameter (binary.format for JDBC) to disable binary
communication between clients (jdbc/odbc) and server.
* for CLI - "binary" command line parameter (or -b) is introduced. Default value is "true".
* binary communication (cbor) is enabled by default
* disabling request parameter introduced for debugging purposes only

(cherry picked from commit f96a5ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants