MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getColIdxToScan

Function getColIdxToScan

src/processor/map/map_path_property_probe.cpp:20–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace processor {
19
20static std::pair<std::vector<struct_field_idx_t>, std::vector<ft_col_idx_t>> getColIdxToScan(
21 const expression_vector& payloads, uint32_t numKeys, const LogicalType& structType) {
22 std::unordered_map<std::string, ft_col_idx_t> propertyNameToColumnIdx;
23 for (auto i = 0u; i < payloads.size(); ++i) {
24 DASSERT(payloads[i]->expressionType == ExpressionType::PROPERTY);
25 auto propertyName = payloads[i]->ptrCast<PropertyExpression>()->getPropertyName();
26 StringUtils::toUpper(propertyName);
27 propertyNameToColumnIdx.insert({propertyName, i + numKeys});
28 }
29 const auto& structFields = StructType::getFields(structType);
30 std::vector<struct_field_idx_t> structFieldIndices;
31 std::vector<ft_col_idx_t> colIndices;
32 for (auto i = 0u; i < structFields.size(); ++i) {
33 auto field = structFields[i].copy();
34 auto fieldName = StringUtils::getUpper(field.getName());
35 if (propertyNameToColumnIdx.contains(fieldName)) {
36 structFieldIndices.push_back(i);
37 colIndices.push_back(propertyNameToColumnIdx.at(fieldName));
38 }
39 }
40 return std::make_pair(std::move(structFieldIndices), std::move(colIndices));
41}
42
43std::unique_ptr<PhysicalOperator> PlanMapper::mapPathPropertyProbe(
44 const LogicalOperator* logicalOperator) {

Callers 1

mapPathPropertyProbeMethod · 0.85

Calls 7

sizeMethod · 0.45
getPropertyNameMethod · 0.45
insertMethod · 0.45
copyMethod · 0.45
getNameMethod · 0.45
containsMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected