| 18 | namespace processor { |
| 19 | |
| 20 | static 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 | |
| 43 | std::unique_ptr<PhysicalOperator> PlanMapper::mapPathPropertyProbe( |
| 44 | const LogicalOperator* logicalOperator) { |
no test coverage detected