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

    https://github.com/apache/incubator-quickstep/pull/229#discussion_r110294927
  
    --- Diff: parser/ParseSetOperation.hpp ---
    @@ -0,0 +1,136 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + **/
    +
    +#ifndef QUICKSTEP_PARSER_PARSE_SET_OPERATION_HPP_
    +#define QUICKSTEP_PARSER_PARSE_SET_OPERATION_HPP_
    +
    +#include <string>
    +#include <vector>
    +
    +#include "parser/ParseTreeNode.hpp"
    +#include "utility/Macros.hpp"
    +#include "utility/PtrList.hpp"
    +
    +namespace quickstep {
    +
    +/** \addtogroup Parser
    + *  @{
    + */
    +
    +/**
    + * @brief A parsed representation of set operations.
    + */
    +class ParseSetOperation : public ParseTreeNode {
    + public:
    +  /**
    +   * @brief The possible types of set operations.
    +   */
    +  enum SetOperationType {
    +    kIntersect,
    +    kSingle,
    +    kUnion,
    +    kUnionAll
    +  };
    +
    +  /**
    +   * @brief Constructor.
    +   *
    +   * @param line_number Line number of the set operation token in the SQL 
statement.
    +   * @param column_number Column number of the set operation toke in the 
SQL statement.
    +   * @param set_operation The set operation type.
    +   */
    +  ParseSetOperation(const int line_number,
    +                    const int column_number,
    +                    const SetOperationType set_operation_type)
    +      : ParseTreeNode(line_number, column_number),
    +        set_operation_type_(set_operation_type) {
    +  }
    +
    +  /**
    +   * @brief Destructor.
    +   */
    +  ~ParseSetOperation() override {}
    +
    +  std::string getName() const override {
    +    switch (set_operation_type_) {
    +      case kIntersect:
    +        return "Intersect";
    +      case kUnion:
    +        return "Union";
    +      case kUnionAll:
    +        return "UnionAll";
    +      case kSingle:
    +        return "Single";
    +      default:
    +        return "Unknown";
    --- End diff --
    
    Suggest to change to `LOG(FATAL) << "Unknown set operation type.";`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to