-
Notifications
You must be signed in to change notification settings - Fork 614
[client-v2] Send parameters in request body #2713
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
base: main
Are you sure you want to change the base?
Conversation
…ion stream to proper handle resources.
…e flag - false by default
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
kavirajk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (given my limited Java knowledge 😆 )
Left few minor comments. Approving to unblock
| * If parameters should be sent in request body. | ||
| * Note: work only with HTTP Compression | ||
| */ | ||
| USE_HTTP_FORM_REQUEST_FOR_QUERY("client.http.use_form_request_for_query", Boolean.class, "false"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Can we name the config HTTP_SEND_PARAMS_IN_BODY instead? Not sure if there are any standard way to name these in java client. But just looking at it, made me confuse. Mainly FOR_QUERY is too generic and no where it says about parameters?.
or USE_HTTP_FORM_REQUEST_FOR_QUERY_PARAMS but I felt that is bit too mouthful. Given it's a boolean we can avoid USE_ prefix I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
I struggle to find good names sometimes.
| @Override | ||
| public long getContentLength() { | ||
| return httpEntity.getContentLength(); | ||
| // compressed request length is unknown event if it is a byte[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be even not event?
|
|
||
| /** | ||
| * If parameters should be sent in request body. | ||
| * Note: work only with HTTP Compression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it works with both HTTP compression and block level compression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for server side compression only. I will rephrase the comment.
It doesn't work with client side compression because requires to compress each parameter what would be expensive.
| params); | ||
| fail("exception expected"); | ||
| } catch (Exception e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is used for debugging. and should be replaced with throw instead of print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, in general it should be logged or thrown. Using printStackTrace is not good. Even in tests we have org.testng.Assert#fail(java.lang.String, java.lang.Throwable).
I've changed code so this test branch is positive now.
|
Thank you, @kavirajk ! I appreciate your review! |



Summary
USE_HTTP_FORM_REQUEST_FOR_QUERYCloses #2324
Checklist
Delete items not relevant to your PR:
Note
Introduces HTTP form-data support for query parameters and refactors HTTP transport/compression for cleaner APIs.
USE_HTTP_FORM_REQUEST_FOR_QUERYand builder methoduseHttpFormDataForQuery(...)to sendstatement_paramsin request body for query operationsHttpAPIClientHelper(executeMultiPartRequest) and a string-bodyexecuteRequest(..., String); factors URI/context/header building; pools venting extractedLZ4FactoryinsideHttpAPIClientHelper; updates call sites to drop passing it per-callgetContentLength()reporting (-1) and ensure proper stream closing inCompressedEntity/LZ4Entitylz4Factory; route query with params to multipart when enabled; minor logging target changestestMultiPartRequest; update default config size assertions (+1)Written by Cursor Bugbot for commit 4611d05. This will update automatically on new commits. Configure here.