Skip to content

Refactor joinGet and implement multi-key lookup.#12418

Merged
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
amosbird:jgmk
Jul 22, 2020
Merged

Refactor joinGet and implement multi-key lookup.#12418
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
amosbird:jgmk

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Now joinGet supports multi-key lookup.

#12409

Detailed description / Documentation draft:

Actually the current document implies the use case of multi-keys. Nothing needs to be changed.

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Jul 11, 2020
@amosbird amosbird force-pushed the jgmk branch 4 times, most recently from 70339a5 to 14d2984 Compare July 12, 2020 10:59
@amosbird
Copy link
Copy Markdown
Collaborator Author

Irrelevant failure due to test is flaky.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It means that the 3rd argument is always constant - does not look correct.
Did you mean - first two arguments ({0, 1})?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I'll update...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it legal?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

getReturnType is supposed to be a private method for overload resolution. The return type can also be directly inferred in method build when Nullable is handled manually. I'll add some comment...

@alexey-milovidov
Copy link
Copy Markdown
Member

Irrelevant failure due to test is flaky.

BTW, performance test has failed not because it is flaky but because performance on master has been improved.

throw Exception(
"Number of arguments for function " + getName() + " doesn't match: passed " + toString(number_of_arguments)
+ ", should be greater or equal to 3",
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
Copy link
Copy Markdown
Member

@azat azat Jul 22, 2020

Choose a reason for hiding this comment

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

I don't see where checkNumberOfArgumentsIfVariadic() is called, in this case it should bail out in getJoin when it access arguments w/o checking, but why the tests passed?

Interesting, it does not SIGSEGV's because there is std::out_of_range exception:

2020.07.15 06:50:15.428892 [ 225276 ] {a1cfa369-a232-4df9-a456-95ee0af99391} executeQuery: (from [::1]:44804) SELECT joinGet();
2020.07.15 06:50:15.429338 [ 225276 ] {a1cfa369-a232-4df9-a456-95ee0af99391} executeQuery: std::exception. Code: 1001, type: std::out_of_range, e.what() = vector (version 20.7.1.4090) (from [::1]:44804) (in query: SELECT joinGet(); )

@akuzm worth converting out_of_range to abort() ? (like in #12522 and related)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW this is the only std exception in the log:

$ fgrep -a 'type: std::' clickhouse-server.log  -c
99

(log from this build stateless tests)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see where checkNumberOfArgumentsIfVariadic() is called, in this case it should bail out in getJoin when it access arguments w/o checking

#12705

@akuzm worth converting out_of_range to abort() ? (like in #12522 and related)

#12704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants