Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/976#discussion_r85255147
  
    --- Diff: src/test/feature/lib/sql_util.cpp ---
    @@ -268,6 +268,17 @@ std::string SQLUtility::getQueryResult(const 
std::string &query) {
       return value;
     }
     
    +std::string SQLUtility::getQueryResultSetString(const std::string &query) {
    +  const hawq::test::PSQLQueryResult &result = executeQuery(query);
    +  std::vector<std::vector<string> > resultString = result.getRows();
    +  string resultStr;
    +  for (auto row : result.getRows()) {
    --- End diff --
    
    Use reference to avoid copy. 
    
    ```
    for(auto & row: result.getRows()) {
      for(auto & column : row) resultStr += column + "|";
      resultStr += '\n';
      ...
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to