@@ -39,17 +39,9 @@ kvstore::ResultCode QueryEdgePropsProcessor::collectEdgesProps(
     return ret;
 }
 
-void QueryEdgePropsProcessor::addDefaultProps() {
-    this->edgeContext_.props_.emplace_back("_src", 0, PropContext::PropInKeyType::SRC);
-    this->edgeContext_.props_.emplace_back("_rank", 1, PropContext::PropInKeyType::RANK);
-    this->edgeContext_.props_.emplace_back("_dst", 2, PropContext::PropInKeyType::DST);
-}
-
 void QueryEdgePropsProcessor::process(const cpp2::EdgePropRequest& req) {
     spaceId_ = req.get_space_id();
-    // By default, _src, _rank, _dst will be returned as the first 3 fields
-    addDefaultProps();
-    int32_t returnColumnsNum = req.get_return_columns().size() + this->edgeContext_.props_.size();
+    //    initContext(req.edge_types, true);
     auto retCode = this->checkAndBuildContexts(req);
     if (retCode != cpp2::ErrorCode::SUCCEEDED) {
         for (auto& p : req.get_parts()) {
/* Copyright (c) 2018 vesoft inc. All rights reserved.
 *
 * This source code is licensed under Apache 2.0 License,
 * attached with Common Clause Condition 1.0, found in the LICENSES directory.
 */

#include "storage/QueryEdgePropsProcessor.h"
#include "base/NebulaKeyUtils.h"
#include <algorithm>
#include "time/Duration.h"
#include "dataman/RowReader.h"
#include "dataman/RowWriter.h"

namespace nebula {
namespace storage {

kvstore::ResultCode QueryEdgePropsProcessor::collectEdgesProps(
                                       PartitionID partId,
                                       const cpp2::EdgeKey& edgeKey,
                                       std::vector<PropContext>& props,
                                       RowSetWriter& rsWriter) {
    auto prefix = NebulaKeyUtils::prefix(partId, edgeKey.src, edgeKey.edge_type,
                                         edgeKey.ranking, edgeKey.dst);
    std::unique_ptr<kvstore::KVIterator> iter;
    auto ret = kvstore_->prefix(spaceId_, partId, prefix, &iter);
    // Only use the latest version.
    if (iter && iter->valid()) {
        RowWriter writer(rsWriter.schema());
        PropsCollector collector(&writer);
        auto reader = RowReader::getEdgePropReader(schemaMan_,
                                                   iter->val(),
                                                   spaceId_,
                                                   edgeKey.edge_type);
        this->collectProps(reader.get(), iter->key(), props, nullptr, &collector);
        rsWriter.addRow(writer);

        iter->next();
    }
    return ret;
}

void QueryEdgePropsProcessor::addDefaultProps() {
    this->edgeContext_.props_.emplace_back("_src", 0, PropContext::PropInKeyType::SRC);
    this->edgeContext_.props_.emplace_back("_rank", 1, PropContext::PropInKeyType::RANK);
    this->edgeContext_.props_.emplace_back("_dst", 2, PropContext::PropInKeyType::DST);
}

void QueryEdgePropsProcessor::process(const cpp2::EdgePropRequest& req) {
    spaceId_ = req.get_space_id();
    // By default, _src, _rank, _dst will be returned as the first 3 fields
    addDefaultProps();
    int32_t returnColumnsNum = req.get_return_columns().size() + this->edgeContext_.props_.size();
    auto retCode = this->checkAndBuildContexts(req);
    if (retCode != cpp2::ErrorCode::SUCCEEDED) {
        for (auto& p : req.get_parts()) {
            this->pushResultCode(retCode, p.first);
        }
        this->onFinished();
        return;
    }

    RowSetWriter rsWriter;
    std::for_each(req.get_parts().begin(), req.get_parts().end(), [&](auto& partE) {
        auto partId = partE.first;
        kvstore::ResultCode ret;
        for (auto& edgeKey : partE.second) {
            ret = this->collectEdgesProps(partId, edgeKey, this->edgeContext_.props_, rsWriter);
            if (ret != kvstore::ResultCode::SUCCEEDED) {
                break;
            }
        }
        // TODO handle failures
        this->pushResultCode(this->to(ret), partId);
    });
    resp_.set_data(std::move(rsWriter.data()));

    std::vector<PropContext> props;
    props.reserve(returnColumnsNum);
    for (auto& prop : this->edgeContext_.props_) {
        props.emplace_back(std::move(prop));
    }
    std::sort(props.begin(), props.end(), [](auto& l, auto& r){
        return l.retIndex_ < r.retIndex_;
    });
    decltype(resp_.schema) s;
    decltype(resp_.schema.columns) cols;
    for (auto& prop : props) {
        VLOG(3) << prop.prop_.name << "," << static_cast<int8_t>(prop.type_.type);
        cols.emplace_back(
                columnDef(std::move(prop.prop_.name),
                          prop.type_.type));
    }
    s.set_columns(std::move(cols));
    resp_.set_schema(std::move(s));
    this->onFinished();
}

}  // namespace storage
}  // namespace nebula

Why remove the default props?