diff options
author | arkady-e1ppa <arkady-e1ppa@yandex-team.com> | 2024-11-08 19:15:54 +0300 |
---|---|---|
committer | arkady-e1ppa <arkady-e1ppa@yandex-team.com> | 2024-11-08 19:28:18 +0300 |
commit | 69ea2aad0490aa3b45a377306f29d0e94876ee68 (patch) | |
tree | 31ca006abc59af483f916d4aa2651506a8ae18d1 /yql/essentials/core/extract_predicate/ut | |
parent | 29bd656ff6c7a9260405dc556cf9b56765f16eb4 (diff) | |
download | ydb-69ea2aad0490aa3b45a377306f29d0e94876ee68.tar.gz |
YT-21233: Rewrite ConvertTo CPO using TagInvoke
Plan:
1) Remove `IAttributedDictionary` type from the public API. \+
2) Remove `Set` method from public API in favor of `operator<<=`. \+
3) Adopt `ConvertTo<T>` (or other name) CPO with proper extension into `NYT::NYson::ConvertTo` from `yt/core`.
4) Use CPO from (3) to eliminate direct dependency on `yt/core` of `Get/Find` methods from attributes API.
5) Adopt `ConvertToYsonString` (or other name) CPO with proper extension into `yt/core` customisations.
6) Use CPO from (5) to eliminate direct dependency on `yt/core` of `TErrorAttribute` ctor.
7) Swap attributes implementation to the one which doesn’t use `IAttributeDictionary`.
8) At this point `stripped_error*` can be moved to library/cpp/yt and so can recursively dependant on THROW macro methods `Get/Find/…`.
9) Adjust CPO’s to work with `std::string` instead of `TYsonString` assuming text format to be used (maybe `TString` for now).
10) Remove dep of `library/cpp/yt/error` on `yson` entirely.
This pr addresses 3-4 steps of plan. Below is a brief explanation of design decisions.
We want to have a concept which detects if there is a `ConvertTo` method and if true, try calling it. Templates can only perform unqualified name lookup and if we allow non-ADL overloads to be found, we would have dependency on inclusion order (if `ConvertTo` is included prior to our code, everything works fine, but if the order is reverse, templated dispatch would fail, but direct call would work just fine). That is why we adopt niebloids which first disable ADL lookup of the name `ConvertTo` by directing it to niebloid implemented via `TagInvoke` mechanism. TagInvoke design <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1895r0.pdf> . TL;DR: we want to have behavior which is consistent with inclusion order.
Key difference now is that `ConvertTo` works consistently in both manual calls and template function body calls and is no longer visible for ADL part of the unqualified name lookup
commit_hash:32af641bd0af559bfe670c2ceb36721fb4afc2dd
Diffstat (limited to 'yql/essentials/core/extract_predicate/ut')
0 files changed, 0 insertions, 0 deletions