MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / handleAnyJoinState

Method handleAnyJoinState

src/Processors/Transforms/MergeJoinTransform.cpp:895–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893};
894
895std::optional<MergeJoinAlgorithm::Status> MergeJoinAlgorithm::handleAnyJoinState()
896{
897 if (any_join_state.empty())
898 return {};
899
900 Chunk result;
901
902 for (size_t source_num = 0; source_num < 2; ++source_num)
903 {
904 auto & current = cursors[source_num];
905 if (any_join_state.keys[source_num].equals(current))
906 {
907 size_t start_pos = current.getRow();
908 size_t length = nextDistinct(current);
909
910 if (length && isLeft(kind) && source_num == 0)
911 {
912 if (any_join_state.value)
913 result = copyChunkResized(current.getCurrent(), any_join_state.value, start_pos, length);
914 else
915 result = createBlockWithDefaults(source_num, start_pos, length);
916 }
917
918 if (length && isRight(kind) && source_num == 1)
919 {
920 if (any_join_state.value)
921 result = copyChunkResized(any_join_state.value, current.getCurrent(), start_pos, length);
922 else
923 result = createBlockWithDefaults(source_num, start_pos, length);
924 }
925
926 if (current.isValid())
927 any_join_state.keys[source_num].reset();
928 }
929 else
930 {
931 any_join_state.keys[source_num].reset();
932 }
933 }
934
935 if (result)
936 return Status(std::move(result));
937 return {};
938}
939
940MergeJoinAlgorithm::Status MergeJoinAlgorithm::anyJoin()
941{

Callers

nothing calls this directly

Calls 9

isLeftFunction · 0.85
copyChunkResizedFunction · 0.85
isRightFunction · 0.85
StatusClass · 0.50
emptyMethod · 0.45
equalsMethod · 0.45
getRowMethod · 0.45
isValidMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected