MCPcopy Create free account
hub / github.com/bytedance/bolt / fillLeftSemiProjectMatchColumn

Method fillLeftSemiProjectMatchColumn

bolt/exec/HashProbe.cpp:860–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858} // namespace
859
860void HashProbe::fillLeftSemiProjectMatchColumn(vector_size_t size) {
861 if (emptyBuildSide()) {
862 // Build side is empty or all rows have null join keys.
863 if (nullAware_ && buildSideHasNullKeys_) {
864 matchColumn() = BaseVector::createNullConstant(BOOLEAN(), size, pool());
865 } else {
866 matchColumn() = createConstantFalse(size, pool());
867 }
868 } else {
869 auto flatMatch = matchColumn()->as<FlatVector<bool>>();
870 flatMatch->resize(size);
871 auto rawValues = flatMatch->mutableRawValues<uint64_t>();
872 for (auto i = 0; i < size; ++i) {
873 if (nullAware_) {
874 // Null-aware join may produce TRUE, FALSE or NULL.
875 if (filter_) {
876 if (leftSemiProjectIsNull_.isValid(i)) {
877 flatMatch->setNull(i, true);
878 } else {
879 bool hasMatch = outputTableRows_[i] != nullptr;
880 bits::setBit(rawValues, i, hasMatch);
881 }
882 } else {
883 if (!nonNullInputRows_.isValid(i)) {
884 // Probe key is null.
885 flatMatch->setNull(i, true);
886 } else {
887 // Probe key is not null.
888 bool hasMatch = outputTableRows_[i] != nullptr;
889 if (!hasMatch && buildSideHasNullKeys_) {
890 flatMatch->setNull(i, true);
891 } else {
892 bits::setBit(rawValues, i, hasMatch);
893 }
894 }
895 }
896 } else {
897 bool hasMatch = outputTableRows_[i] != nullptr;
898 bits::setBit(rawValues, i, hasMatch);
899 }
900 }
901 }
902}
903
904void HashProbe::fillOutput(vector_size_t size) {
905 prepareOutput(size);

Callers

nothing calls this directly

Calls 6

createConstantFalseFunction · 0.85
isValidMethod · 0.80
setBitFunction · 0.70
poolFunction · 0.50
resizeMethod · 0.45
setNullMethod · 0.45

Tested by

no test coverage detected