You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by sh...@apache.org on 2016/06/17 15:56:14 UTC

[4/4] incubator-quickstep git commit: Addressing comment issues

Addressing comment issues


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/fbe049f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/fbe049f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/fbe049f8

Branch: refs/heads/SQL-window-aggregation
Commit: fbe049f8969416d0b5e5b5eef7c5cd64a6ef156d
Parents: 9d36beb
Author: shixuan <sh...@wisc.edu>
Authored: Fri Jun 17 15:44:59 2016 +0000
Committer: shixuan <sh...@wisc.edu>
Committed: Fri Jun 17 15:44:59 2016 +0000

----------------------------------------------------------------------
 parser/CMakeLists.txt                 |   4 +-
 parser/ParseBasicExpressions.hpp      |   4 +-
 parser/ParseSelect.hpp                |   4 +-
 parser/ParseWindow.hpp                |  12 +-
 parser/SqlLexer.lpp                   |   2 +-
 parser/SqlParser.ypp                  |   2 +-
 parser/preprocessed/SqlLexer_gen.cpp  |  16 +-
 parser/preprocessed/SqlParser_gen.cpp | 790 +++++++++++++++--------------
 parser/preprocessed/SqlParser_gen.hpp |   8 +-
 parser/tests/Select.test              |  48 +-
 10 files changed, 447 insertions(+), 443 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt
index 6bfe083..a10c088 100644
--- a/parser/CMakeLists.txt
+++ b/parser/CMakeLists.txt
@@ -113,8 +113,8 @@ add_library(quickstep_parser_ParseSubqueryExpression ParseSubqueryExpression.cpp
 add_library(quickstep_parser_ParseSubqueryTableReference ParseSubqueryTableReference.cpp ParseSubqueryTableReference.hpp)
 add_library(quickstep_parser_ParseTableReference ParseTableReference.cpp ParseTableReference.hpp)
 add_library(quickstep_parser_ParseTreeNode ../empty_src.cpp ParseTreeNode.hpp)
-add_library(quickstep_parser_ParserUtil ParserUtil.cpp ParserUtil.hpp)
 add_library(quickstep_parser_ParseWindow ../empty_src.cpp ParseWindow.hpp)
+add_library(quickstep_parser_ParserUtil ParserUtil.cpp ParserUtil.hpp)
 add_library(quickstep_parser_SqlParserWrapper SqlParserWrapper.cpp SqlParserWrapper.hpp)
 add_library(quickstep_parser_SqlParser ${BISON_SqlParser_OUTPUTS})
 add_library(quickstep_parser_SqlLexer ${FLEX_SqlLexer_OUTPUTS})
@@ -346,8 +346,8 @@ target_link_libraries(quickstep_parser_SqlParser
                       quickstep_parser_ParseSubqueryExpression
                       quickstep_parser_ParseSubqueryTableReference
                       quickstep_parser_ParseTableReference
-                      quickstep_parser_ParserUtil
                       quickstep_parser_ParseWindow
+                      quickstep_parser_ParserUtil
                       quickstep_storage_StorageBlockInfo
                       quickstep_types_Type
                       quickstep_types_TypeFactory

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/ParseBasicExpressions.hpp
----------------------------------------------------------------------
diff --git a/parser/ParseBasicExpressions.hpp b/parser/ParseBasicExpressions.hpp
index 727fa10..65cd0d3 100644
--- a/parser/ParseBasicExpressions.hpp
+++ b/parser/ParseBasicExpressions.hpp
@@ -459,7 +459,7 @@ class ParseFunctionCall : public ParseExpression {
    * @param window_name The window name.
    **/
   void setWindowName(ParseString *window_name) {
-    window_name_.reset(std::move(window_name));
+    window_name_.reset(window_name);
   }
 
   /**
@@ -467,7 +467,7 @@ class ParseFunctionCall : public ParseExpression {
    * @param window The window.
    **/
   void setWindow(ParseWindow *window) {
-    window_.reset(std::move(window));
+    window_.reset(window);
   }
 
   std::string generateName() const override;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/ParseSelect.hpp
----------------------------------------------------------------------
diff --git a/parser/ParseSelect.hpp b/parser/ParseSelect.hpp
index 5c90951..dd81b4a 100644
--- a/parser/ParseSelect.hpp
+++ b/parser/ParseSelect.hpp
@@ -181,7 +181,7 @@ class ParseSelect : public ParseTreeNode {
     if (from_list_ != nullptr) {
       container_child_field_names->push_back("from_clause");
       container_child_fields->emplace_back();
-      for (const ParseTableReference& from_item : *from_list_) {
+      for (const ParseTableReference &from_item : *from_list_) {
         container_child_fields->back().push_back(&from_item);
       }
     }
@@ -209,7 +209,7 @@ class ParseSelect : public ParseTreeNode {
     if (window_list_ != nullptr) {
       container_child_field_names->push_back("window_list");
       container_child_fields->emplace_back();
-      for (const ParseWindow& window : *window_list_) {
+      for (const ParseWindow &window : *window_list_) {
         container_child_fields->back().push_back(&window);
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/ParseWindow.hpp
----------------------------------------------------------------------
diff --git a/parser/ParseWindow.hpp b/parser/ParseWindow.hpp
index 5660f4e..0da4ec4 100644
--- a/parser/ParseWindow.hpp
+++ b/parser/ParseWindow.hpp
@@ -56,9 +56,9 @@ struct ParseFrameInfo : ParseTreeNode {
 
   std::string getName() const override { return "FrameInfo"; }
 
-  bool is_row;
-  long num_preceding;
-  long num_following;
+  const bool is_row;
+  const long num_preceding;
+  const long num_following;
 
  protected:
   void getFieldStringItems(
@@ -121,14 +121,14 @@ class ParseWindow : public ParseTreeNode {
   /**
    * @brief Grouping expressions.
    **/
-  const PtrList<ParseExpression> *partition_by_expressions() const {
+  const PtrList<ParseExpression>* partition_by_expressions() const {
     return partition_by_expressions_.get();
   }
 
   /**
    * @brief Ordering expressions.
    **/
-  const PtrList<ParseOrderByItem> *order_by_expressions() const {
+  const PtrList<ParseOrderByItem>* order_by_expressions() const {
     return order_by_expressions_.get();
   }
 
@@ -151,7 +151,7 @@ class ParseWindow : public ParseTreeNode {
    * @param name The alias of the window.
    **/
   void setName(ParseString *name) {
-    name_.reset(std::move(name));
+    name_.reset(name);
   }
 
  protected:

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/SqlLexer.lpp
----------------------------------------------------------------------
diff --git a/parser/SqlLexer.lpp b/parser/SqlLexer.lpp
index 4ae116a..ee34400 100644
--- a/parser/SqlLexer.lpp
+++ b/parser/SqlLexer.lpp
@@ -212,10 +212,10 @@ unsigned_numeric_literal {exact_numeric_literal}|{approximate_numeric_literal}
   "false"            return TOKEN_FALSE;
   "first"            return TOKEN_FIRST;
   "float"            return TOKEN_FLOAT;
+  "following"        return TOKEN_FOLLOWING;
   "for"              return TOKEN_FOR;
   "foreign"          return TOKEN_FOREIGN;
   "from"             return TOKEN_FROM;
-  "following"        return TOKEN_FOLLOWING;
   "full"             return TOKEN_FULL;
   "group"            return TOKEN_GROUP;
   "hash"             return TOKEN_HASH;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/SqlParser.ypp
----------------------------------------------------------------------
diff --git a/parser/SqlParser.ypp b/parser/SqlParser.ypp
index df45542..7fcee8a 100644
--- a/parser/SqlParser.ypp
+++ b/parser/SqlParser.ypp
@@ -567,8 +567,8 @@ void NotSupported(const YYLTYPE *location, yyscan_t yyscanner, const std::string
   opt_sample_clause
 
 %type <opt_window_clause_>
-  window_declaration_list
   opt_window_clause
+  window_declaration_list
 
 %type <window_definition_>
   window_declaration

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/fbe049f8/parser/preprocessed/SqlLexer_gen.cpp
----------------------------------------------------------------------
diff --git a/parser/preprocessed/SqlLexer_gen.cpp b/parser/preprocessed/SqlLexer_gen.cpp
index 05c3a35..d02db56 100644
--- a/parser/preprocessed/SqlLexer_gen.cpp
+++ b/parser/preprocessed/SqlLexer_gen.cpp
@@ -412,7 +412,7 @@ static yyconst flex_int16_t yy_accept[588] =
       154,  154,  154,  154,   33,  154,  154,  154,  154,  154,
 
       154,  154,  154,   44,  154,  154,  154,  154,  154,  154,
-      154,   51,  154,  154,  154,  154,  154,  154,  154,  154,
+      154,   52,  154,  154,  154,  154,  154,  154,  154,  154,
       154,   64,  154,   70,  154,  154,  154,  154,  154,  154,
       154,   78,  154,   81,  154,  154,  154,  154,  154,  154,
       154,  154,  154,  154,  154,  154,  154,   98,  154,  154,
@@ -422,7 +422,7 @@ static yyconst flex_int16_t yy_accept[588] =
       154,  154,  154,   28,  154,  154,  154,   31,  154,  154,
       154,  154,   38,  154,  154,   42,   43,  154,  154,  154,
 
-      154,  154,  154,  154,  154,   53,   55,  154,   57,  154,
+      154,  154,  154,  154,  154,   54,   55,  154,   57,  154,
        59,  154,  154,  154,  154,   67,   69,   71,   72,   73,
       154,   75,  154,  154,   79,  154,  154,   86,  154,  154,
       154,  154,   92,  154,   94,  154,  154,  154,  100,  154,
@@ -444,12 +444,12 @@ static yyconst flex_int16_t yy_accept[588] =
       154,  154,   13,  154,  154,  154,  154,  154,  154,   21,
        30,  154,   34,   35,  154,  154,  154,  154,   47,  154,
 
-       52,   65,  154,  154,   89,  154,   91,  154,  154,  154,
+       53,   65,  154,  154,   89,  154,   91,  154,  154,  154,
       154,  154,  154,  154,  118,  154,  154,  154,  154,  154,
       154,  154,  154,   32,  154,  154,   40,  154,  154,   66,
       154,  154,  154,  154,  105,  154,  154,  154,  154,  154,
        12,  154,  154,  154,  154,   24,  154,   37,  154,  154,
-       54,   87,   90,  154,  154,  106,  110,  154,  113,  124,
+       51,   87,   90,  154,  154,  106,  110,  154,  113,  124,
        16,  154,  154,  154,   27,   39,  154,   88,   95,  154,
       154,  154,   18,   19,  154,  154,  112,  154,  154,  154,
       154,  154,   99,  154,   45,   17,    0
@@ -1715,22 +1715,22 @@ return TOKEN_FLOAT;
 case 51:
 YY_RULE_SETUP
 #line 215 "../SqlLexer.lpp"
-return TOKEN_FOR;
+return TOKEN_FOLLOWING;
 	YY_BREAK
 case 52:
 YY_RULE_SETUP
 #line 216 "../SqlLexer.lpp"
-return TOKEN_FOREIGN;
+return TOKEN_FOR;
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
 #line 217 "../SqlLexer.lpp"
-return TOKEN_FROM;
+return TOKEN_FOREIGN;
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
 #line 218 "../SqlLexer.lpp"
-return TOKEN_FOLLOWING;
+return TOKEN_FROM;
 	YY_BREAK
 case 55:
 YY_RULE_SETUP