-
Notifications
You must be signed in to change notification settings - Fork 163
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
Parameters in clickhouse-cpp #394
base: master
Are you sure you want to change the base?
Conversation
OlegGalizin
commented
Sep 20, 2024
- params
- Nullable params
Oleg Galizin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
What can I do to help you to merge the request? |
Is I doing something wrong or nobody has time to merge the request? |
@OlegGalizin |
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.
Proper high-level description of the added feature is missing. Please add one as a PR description. Having one greatly simplifies review.
Also, could you please create some unit-tests for this functionality? That way there is a chance that nobody is going to break this feature after it is merged. You can add test cases to the ut/client_ut.cpp
or create a new test unit-test file for parameters specifically.
Hi @OlegGalizin thanks for submitting a PR, please address mentioned issues. |
I've add ci test. I did'n found how can I change a PR description. If You can please add the description in proper place please. |
Please help me run the tests |
const char quoted_chars[] = {'\0', '\b', '\t', '\n', '\'', '\\'}; | ||
|
||
inline const char* find_quoted_chars(const char* start, const char* end) { | ||
while (start < end) { |
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.
Why not std::find_first_of
?
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 more comfortable for me.
I think std::find_first_of needs
one extra compare because it return 'end' on failure
Or after call we needs compare with 'end' that worse then comparing with 0
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.
Please use functions from standard library whenever possible, instead of inventing new ones with 99% overlapping functionality. "comfortable for me" is not a valid excuse...
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.
What about extra compare instruction and slow down the solution?
I must be sure that you are understand that you suggest
se for example find_first_symbols_sse2 in main clickhouse repo that also uses double loop and return nullptr
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.
First, find_first_symbols_sse2
was introduced to be used in a very hot pieces of code, which I believe is not the case here.
Second, there is a very high chance that compiler can optimize call std::find_first_of
(e.g. using SSE) way beyond anything you are trying to gain here.
And last, find_first_symbols_sse2
supports two modes: "return nullptr
" and "return end
" 😉.
This looks like you are trying to prematurely optimize O(N + 1)
into O(N)
, by introducing something that would unnecessary complicate the support.
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.
Please fix issues in the PR
Please fix the tests |
@OlegGalizin please fix tests |
@OlegGalizin ping, |
@Enmk
I checked Do you want to switch off the test? |
Some unit tests are conditionally skipped based on clickhouse version, please check the code and modify your tests accordingly. And please either get rid of |
Please do it himself. |
How about merge the PR to master? |