http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/Aggregate.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/Aggregate.hpp b/query_optimizer/physical/Aggregate.hpp deleted file mode 100644 index de36cc3..0000000 --- a/query_optimizer/physical/Aggregate.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_AGGREGATE_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_AGGREGATE_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/Alias.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/expressions/Predicate.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerLogical - * @{ - */ - -class Aggregate; -typedef std::shared_ptr<const Aggregate> AggregatePtr; - -/** - * @brief Aggregate operator that computes aggregate expressions for each combination - * of the values of grouping expressions. - */ -class Aggregate : public Physical { - public: - PhysicalType getPhysicalType() const override { return PhysicalType::kAggregate; } - - std::string getName() const override { return "Aggregate"; } - - /** - * @return The input physical node. - */ - const PhysicalPtr input() const { return input_; } - - /** - * @return Grouping expressions. - */ - inline const std::vector<expressions::NamedExpressionPtr>& grouping_expressions() const { - return grouping_expressions_; - } - - /** - * @return Aggregate expressions. - */ - const std::vector<expressions::AliasPtr>& aggregate_expressions() const { - return aggregate_expressions_; - } - - /** - * @return Filter predicate applied before aggregation. - */ - const expressions::PredicatePtr& filter_predicate() const { - return filter_predicate_; - } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(getNumChildren(), new_children.size()); - return Create(new_children[0], grouping_expressions_, aggregate_expressions_, filter_predicate_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override; - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override; - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - // The project expressions for an Aggregate cannot be changed. - return false; - } - - /** - * @brief Creates an Aggregate physical node. - * - * @param input The input node. - * @param aggregate_expressions The aggregate expressions. - * @param grouping_expressions The grouping expressions. - * @param filter_predicate The filtering predicate applied before aggregation. Can be NULL. - * @return An immutable Aggregate node. - */ - static AggregatePtr Create( - PhysicalPtr input, - const std::vector<expressions::NamedExpressionPtr> &grouping_expressions, - const std::vector<expressions::AliasPtr> &aggregate_expressions, - const expressions::PredicatePtr &filter_predicate) { - return AggregatePtr( - new Aggregate(input, grouping_expressions, aggregate_expressions, filter_predicate)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - Aggregate( - PhysicalPtr input, - const std::vector<expressions::NamedExpressionPtr> &grouping_expressions, - const std::vector<expressions::AliasPtr> &aggregate_expressions, - const expressions::PredicatePtr &filter_predicate) - : input_(input), - grouping_expressions_(grouping_expressions), - aggregate_expressions_(aggregate_expressions), - filter_predicate_(filter_predicate) { - addChild(input_); - } - - PhysicalPtr input_; - std::vector<expressions::NamedExpressionPtr> grouping_expressions_; - std::vector<expressions::AliasPtr> aggregate_expressions_; - expressions::PredicatePtr filter_predicate_; - - DISALLOW_COPY_AND_ASSIGN(Aggregate); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_AGGREGATE_HPP_ */
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/BinaryJoin.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/BinaryJoin.cpp b/query_optimizer/physical/BinaryJoin.cpp deleted file mode 100644 index 30e2e8d..0000000 --- a/query_optimizer/physical/BinaryJoin.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/BinaryJoin.hpp" - -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "utility/Cast.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -namespace E = ::quickstep::optimizer::expressions; - -void BinaryJoin::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - non_container_child_field_names->push_back("left"); - non_container_child_field_names->push_back("right"); - - non_container_child_fields->push_back(left_); - non_container_child_fields->push_back(right_); - - container_child_field_names->push_back("project_expressions"); - container_child_fields->push_back( - CastSharedPtrVector<OptimizerTreeBase>(project_expressions())); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/BinaryJoin.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/BinaryJoin.hpp b/query_optimizer/physical/BinaryJoin.hpp deleted file mode 100644 index 4b5671d..0000000 --- a/query_optimizer/physical/BinaryJoin.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_BINARY_JOIN_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_BINARY_JOIN_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/physical/Join.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "utility/Macros.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class BinaryJoin; -typedef std::shared_ptr<const BinaryJoin> BinaryJoinPtr; - -/** - * @brief Base class for binary join nodes. - */ -class BinaryJoin : public Join { - public: - /** - * @brief Destructor. - */ - ~BinaryJoin() override {} - - /** - * @return The left operand. - */ - const PhysicalPtr& left() const { return left_; } - - /** - * @return The right operand. - */ - const PhysicalPtr& right() const { return right_; } - - protected: - /** - * @brief Constructor. - * - * @param left The left operand. - * @param right The right operand. - * @param project_expressions The project expressions. - */ - BinaryJoin(const PhysicalPtr &left, - const PhysicalPtr &right, - const std::vector<expressions::NamedExpressionPtr> &project_expressions) - : Join(project_expressions), - left_(left), - right_(right) { - addChild(left_); - addChild(right_); - } - - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - PhysicalPtr left_; - PhysicalPtr right_; - - DISALLOW_COPY_AND_ASSIGN(BinaryJoin); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_BINARY_JOIN_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CMakeLists.txt b/query_optimizer/physical/CMakeLists.txt deleted file mode 100644 index 5c2cd0b..0000000 --- a/query_optimizer/physical/CMakeLists.txt +++ /dev/null @@ -1,301 +0,0 @@ -# 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. - -# Declare micro-libs: -add_library(quickstep_queryoptimizer_physical_Aggregate Aggregate.cpp Aggregate.hpp) -add_library(quickstep_queryoptimizer_physical_BinaryJoin BinaryJoin.cpp BinaryJoin.hpp) -add_library(quickstep_queryoptimizer_physical_CopyFrom CopyFrom.cpp CopyFrom.hpp) -add_library(quickstep_queryoptimizer_physical_CreateIndex CreateIndex.cpp CreateIndex.hpp) -add_library(quickstep_queryoptimizer_physical_CreateTable CreateTable.cpp CreateTable.hpp) -add_library(quickstep_queryoptimizer_physical_DeleteTuples DeleteTuples.cpp DeleteTuples.hpp) -add_library(quickstep_queryoptimizer_physical_DropTable DropTable.cpp DropTable.hpp) -add_library(quickstep_queryoptimizer_physical_HashJoin HashJoin.cpp HashJoin.hpp) -add_library(quickstep_queryoptimizer_physical_InsertSelection InsertSelection.cpp InsertSelection.hpp) -add_library(quickstep_queryoptimizer_physical_InsertTuple InsertTuple.cpp InsertTuple.hpp) -add_library(quickstep_queryoptimizer_physical_Join ../../empty_src.cpp Join.hpp) -add_library(quickstep_queryoptimizer_physical_LIPFilterConfiguration ../../empty_src.cpp LIPFilterConfiguration.hpp) -add_library(quickstep_queryoptimizer_physical_NestedLoopsJoin NestedLoopsJoin.cpp NestedLoopsJoin.hpp) -add_library(quickstep_queryoptimizer_physical_PatternMatcher ../../empty_src.cpp PatternMatcher.hpp) -add_library(quickstep_queryoptimizer_physical_Physical ../../empty_src.cpp Physical.hpp) -add_library(quickstep_queryoptimizer_physical_PhysicalType ../../empty_src.cpp PhysicalType.hpp) -add_library(quickstep_queryoptimizer_physical_Sample Sample.cpp Sample.hpp) -add_library(quickstep_queryoptimizer_physical_Selection Selection.cpp Selection.hpp) -add_library(quickstep_queryoptimizer_physical_SharedSubplanReference - SharedSubplanReference.cpp - SharedSubplanReference.hpp) -add_library(quickstep_queryoptimizer_physical_Sort Sort.cpp Sort.hpp) -add_library(quickstep_queryoptimizer_physical_TableGenerator ../../empty_src.cpp TableGenerator.hpp) -add_library(quickstep_queryoptimizer_physical_TableReference TableReference.cpp TableReference.hpp) -add_library(quickstep_queryoptimizer_physical_TopLevelPlan TopLevelPlan.cpp TopLevelPlan.hpp) -add_library(quickstep_queryoptimizer_physical_UpdateTable UpdateTable.cpp UpdateTable.hpp) -add_library(quickstep_queryoptimizer_physical_WindowAggregate WindowAggregate.cpp WindowAggregate.hpp) - -# Link dependencies: -target_link_libraries(quickstep_queryoptimizer_physical_Aggregate - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_Alias - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_BinaryJoin - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Join - quickstep_queryoptimizer_physical_Physical - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_CopyFrom - glog - quickstep_catalog_CatalogRelation - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_CreateIndex - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_storage_StorageBlockLayout_proto - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_CreateTable - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_DeleteTuples - glog - quickstep_catalog_CatalogRelation - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_DropTable - glog - quickstep_catalog_CatalogRelation - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_HashJoin - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_BinaryJoin - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_InsertSelection - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_InsertTuple - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_ScalarLiteral - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_Join - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_LIPFilterConfiguration - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_utility_Macros - quickstep_utility_lipfilter_LIPFilter) -target_link_libraries(quickstep_queryoptimizer_physical_NestedLoopsJoin - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_BinaryJoin - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_PatternMatcher - quickstep_queryoptimizer_physical_PhysicalType) -target_link_libraries(quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_Sample - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_Selection - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_LogicalAnd - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_SharedSubplanReference - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_Sort - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_TableGenerator - quickstep_expressions_tablegenerator_GeneratorFunctionHandle - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExprId - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_TableReference - glog - quickstep_catalog_CatalogRelation - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_TopLevelPlan - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExprId - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_physical_LIPFilterConfiguration - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_UpdateTable - glog - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_expressions_Scalar - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) -target_link_libraries(quickstep_queryoptimizer_physical_WindowAggregate - quickstep_queryoptimizer_OptimizerTree - quickstep_queryoptimizer_expressions_Alias - quickstep_queryoptimizer_expressions_AttributeReference - quickstep_queryoptimizer_expressions_ExpressionUtil - quickstep_queryoptimizer_expressions_NamedExpression - quickstep_queryoptimizer_expressions_Predicate - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_utility_Cast - quickstep_utility_Macros) - -# Module all-in-one library: -add_library(quickstep_queryoptimizer_physical ../../empty_src.cpp OptimizerPhysicalModule.hpp) -target_link_libraries(quickstep_queryoptimizer_physical - quickstep_queryoptimizer_physical_Aggregate - quickstep_queryoptimizer_physical_BinaryJoin - quickstep_queryoptimizer_physical_CopyFrom - quickstep_queryoptimizer_physical_CreateIndex - quickstep_queryoptimizer_physical_CreateTable - quickstep_queryoptimizer_physical_DeleteTuples - quickstep_queryoptimizer_physical_DropTable - quickstep_queryoptimizer_physical_HashJoin - quickstep_queryoptimizer_physical_InsertSelection - quickstep_queryoptimizer_physical_InsertTuple - quickstep_queryoptimizer_physical_Join - quickstep_queryoptimizer_physical_LIPFilterConfiguration - quickstep_queryoptimizer_physical_NestedLoopsJoin - quickstep_queryoptimizer_physical_PatternMatcher - quickstep_queryoptimizer_physical_Physical - quickstep_queryoptimizer_physical_PhysicalType - quickstep_queryoptimizer_physical_Sample - quickstep_queryoptimizer_physical_Selection - quickstep_queryoptimizer_physical_SharedSubplanReference - quickstep_queryoptimizer_physical_Sort - quickstep_queryoptimizer_physical_TableGenerator - quickstep_queryoptimizer_physical_TableReference - quickstep_queryoptimizer_physical_TopLevelPlan - quickstep_queryoptimizer_physical_UpdateTable - quickstep_queryoptimizer_physical_WindowAggregate) http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CopyFrom.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CopyFrom.cpp b/query_optimizer/physical/CopyFrom.cpp deleted file mode 100644 index 8448d4e..0000000 --- a/query_optimizer/physical/CopyFrom.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/CopyFrom.hpp" - -#include <string> -#include <vector> - -#include "catalog/CatalogRelation.hpp" -#include "query_optimizer/OptimizerTree.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -void CopyFrom::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - inline_field_names->push_back("relation"); - inline_field_values->push_back(catalog_relation_->getName()); - - inline_field_names->push_back("file_name"); - inline_field_values->push_back(file_name_); - - inline_field_names->push_back("column_delimiter"); - inline_field_values->push_back(std::string(1, column_delimiter_)); - - inline_field_names->push_back("escape_strings"); - inline_field_values->push_back(escape_strings_ ? "true" : "false"); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CopyFrom.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CopyFrom.hpp b/query_optimizer/physical/CopyFrom.hpp deleted file mode 100644 index ecbf318..0000000 --- a/query_optimizer/physical/CopyFrom.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_COPYFROM_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_COPYFROM_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { - -class CatalogRelation; - -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class CopyFrom; -typedef std::shared_ptr<const CopyFrom> CopyFromPtr; - -/** - * @brief Represents an operation that copies data from a text file to a relation. - */ -class CopyFrom : public Physical { - public: - PhysicalType getPhysicalType() const override { return PhysicalType::kCopyFrom; } - - std::string getName() const override { return "CopyFrom"; } - - /** - * @return The catalog relation to insert the tuples to. - */ - const CatalogRelation* catalog_relation() const { return catalog_relation_; } - - /** - * @return The name of the file to read the data from. - */ - const std::string& file_name() const { return file_name_; } - - /** - * @return The delimiter used in the text file to separate columns. - */ - const char column_delimiter() const { return column_delimiter_; } - - /** - * @return Whether to decode escape sequences in the text file. - */ - bool escape_strings() const { return escape_strings_; } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK(new_children.empty()); - return Create(catalog_relation_, - file_name_, - column_delimiter_, - escape_strings_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override { - return std::vector<expressions::AttributeReferencePtr>(); - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override { - return std::vector<expressions::AttributeReferencePtr>(); - } - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - return false; - } - - /** - * @brief Creates a CopyFrom physical node. - * - * @param catalog_relation The catalog relation to insert the tuples to. - * @param file_name The name of the file to read the data from. - * @param column_delimiter The delimiter used in the text file to separate - * columns. - * @param escape_strings Whether to decode escape sequences in the text file. - * @return An immutable CopyFrom physical node. - */ - static CopyFromPtr Create(const CatalogRelation *catalog_relation, - const std::string &file_name, - const char &column_delimiter, - bool escape_strings) { - return CopyFromPtr(new CopyFrom(catalog_relation, - file_name, - column_delimiter, - escape_strings)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - CopyFrom(const CatalogRelation *catalog_relation, - const std::string &file_name, - const char column_delimiter, - bool escape_strings) - : catalog_relation_(catalog_relation), - file_name_(file_name), - column_delimiter_(column_delimiter), - escape_strings_(escape_strings) {} - - const CatalogRelation *catalog_relation_; - std::string file_name_; - - const char column_delimiter_; - const bool escape_strings_; - - DISALLOW_COPY_AND_ASSIGN(CopyFrom); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_COPYFROM_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CreateIndex.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CreateIndex.cpp b/query_optimizer/physical/CreateIndex.cpp deleted file mode 100644 index af7d500..0000000 --- a/query_optimizer/physical/CreateIndex.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/CreateIndex.hpp" - -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "utility/Cast.hpp" -#include "utility/Macros.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -void CreateIndex::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - inline_field_names->push_back("index_name"); - inline_field_values->push_back(index_name_); - - non_container_child_field_names->push_back("relation"); - non_container_child_fields->push_back(input_); - - container_child_field_names->push_back("index_attributes"); - container_child_fields->push_back(CastSharedPtrVector<OptimizerTreeBase>(index_attributes_)); - - inline_field_names->push_back("serialized_index_description"); - inline_field_values->push_back(index_description_->DebugString()); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CreateIndex.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CreateIndex.hpp b/query_optimizer/physical/CreateIndex.hpp deleted file mode 100644 index 3847736..0000000 --- a/query_optimizer/physical/CreateIndex.hpp +++ /dev/null @@ -1,156 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_CREATEINDEX_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_CREATEINDEX_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "storage/StorageBlockLayout.pb.h" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class CreateIndex; -typedef std::shared_ptr<const CreateIndex> CreateIndexPtr; - -/** - * @brief Creates an index. - */ -class CreateIndex : public Physical { - public: - PhysicalType getPhysicalType() const override { - return PhysicalType::kCreateIndex; - } - - std::string getName() const override { return "CreateIndex"; } - - /** - * @return The input that produces the relation to create index upon. - */ - const PhysicalPtr& input() const { return input_; } - - /** - * @return The name of the index to be created. - */ - const std::string& index_name() const { return index_name_; } - - /** - * @return The list of attributes to build index upon. - */ - const std::vector<expressions::AttributeReferencePtr>& index_attributes() const { - return index_attributes_; - } - - /** - * @return Shared pointer to the index properties. - */ - std::shared_ptr<const IndexSubBlockDescription> index_description() const { - return index_description_; - } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(getNumChildren(), new_children.size()); - return Create(new_children[0], index_name_, index_attributes_, index_description_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override { - return index_attributes_; - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override { - return index_attributes_; - } - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - return false; - } - - /** - * @brief Creates a CreateIndex physical node that represents an operation to - * create a new index. - * - * @param input The input produces the relation to create index upon. - * @param index_name The name of the index to create. - * @param index_attributes Set of attributes to create index upon. - * @param index_description A proto block describing the set of properties for this index. - * @return An immutable CreateIndex node. - */ - static CreateIndexPtr Create( - const PhysicalPtr &input, - const std::string &index_name, - const std::vector<expressions::AttributeReferencePtr> &index_attributes, - const std::shared_ptr<const IndexSubBlockDescription> &index_description) { - return CreateIndexPtr(new CreateIndex(input, index_name, index_attributes, index_description)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - CreateIndex( - const PhysicalPtr &input, - const std::string &index_name, - const std::vector<expressions::AttributeReferencePtr> &index_attributes, - const std::shared_ptr<const IndexSubBlockDescription> &index_description) - : input_(input), - index_name_(index_name), - index_attributes_(index_attributes), - index_description_(index_description) { - addChild(input_); - } - - const PhysicalPtr input_; - const std::string index_name_; - const std::vector<expressions::AttributeReferencePtr> index_attributes_; - std::shared_ptr<const IndexSubBlockDescription> index_description_; - - DISALLOW_COPY_AND_ASSIGN(CreateIndex); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_CREATEINDEX_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CreateTable.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CreateTable.cpp b/query_optimizer/physical/CreateTable.cpp deleted file mode 100644 index d42eac3..0000000 --- a/query_optimizer/physical/CreateTable.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/CreateTable.hpp" - -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "utility/Cast.hpp" -#include "utility/Macros.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -void CreateTable::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - inline_field_names->push_back("relation"); - inline_field_values->push_back(relation_name_); - - container_child_field_names->push_back("attributes"); - container_child_fields->push_back(CastSharedPtrVector<OptimizerTreeBase>(attributes_)); - - // The tree representation of the LayoutDescription object, if specified by the user. - if (block_properties_representation_) { - non_container_child_field_names->push_back("block_properties"); - non_container_child_fields->push_back(block_properties_representation_); - } -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/CreateTable.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/CreateTable.hpp b/query_optimizer/physical/CreateTable.hpp deleted file mode 100644 index 8e3bbd4..0000000 --- a/query_optimizer/physical/CreateTable.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_CREATETABLE_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_CREATETABLE_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class CreateTable; -typedef std::shared_ptr<const CreateTable> CreateTablePtr; - -/** - * @brief Creates a table. - */ -class CreateTable : public Physical { - public: - PhysicalType getPhysicalType() const override { - return PhysicalType::kCreateTable; - } - - std::string getName() const override { return "CreateTable"; } - - /** - * @return The name of the relation to be inserted. - */ - const std::string& relation_name() const { return relation_name_; } - - /** - * @return Attribute list of the relation. - */ - const std::vector<expressions::AttributeReferencePtr>& attributes() const { - return attributes_; - } - - /** - * @return Shared pointer to the block properties. - */ - const std::shared_ptr<const StorageBlockLayoutDescription> block_properties() const { - return block_properties_; - } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(getNumChildren(), new_children.size()); - return Create(relation_name_, attributes_, block_properties_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override { - return attributes_; - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override { - return attributes_; - } - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - return false; - } - - /** - * @brief Creates a CreateTable physical node that represents an operation to - * create a new table. - * - * @param relation_name The name of the relation to be inserted. - * @param attributes Schema of the relation. - * @param block_properties The optional proto message describing the block. - * @return An immutable CreateTable node. - */ - static CreateTablePtr Create( - const std::string &relation_name, - const std::vector<expressions::AttributeReferencePtr> &attributes, - const std::shared_ptr<const StorageBlockLayoutDescription> &block_properties) { - return CreateTablePtr(new CreateTable(relation_name, attributes, block_properties)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - CreateTable( - const std::string &relation_name, - const std::vector<expressions::AttributeReferencePtr> &attributes, - const std::shared_ptr<const StorageBlockLayoutDescription> &block_properties) - : relation_name_(relation_name), - attributes_(attributes), - block_properties_(block_properties), - block_properties_representation_( - getOptimizerRepresentationForProto<OptimizerTreeBaseNodePtr>(block_properties_.get())) {} - - std::string relation_name_; - std::vector<expressions::AttributeReferencePtr> attributes_; - std::shared_ptr<const StorageBlockLayoutDescription> block_properties_; - std::shared_ptr<const OptimizerProtoRepresentation<OptimizerTreeBaseNodePtr> > block_properties_representation_; - - DISALLOW_COPY_AND_ASSIGN(CreateTable); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_CREATETABLE_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/DeleteTuples.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/DeleteTuples.cpp b/query_optimizer/physical/DeleteTuples.cpp deleted file mode 100644 index 2c93502..0000000 --- a/query_optimizer/physical/DeleteTuples.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/DeleteTuples.hpp" - -#include <string> -#include <vector> - -#include "catalog/CatalogRelation.hpp" -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/Predicate.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -std::vector<expressions::AttributeReferencePtr> DeleteTuples::getReferencedAttributes() const { - if (predicate_ != nullptr) { - return predicate_->getReferencedAttributes(); - } else { - return std::vector<expressions::AttributeReferencePtr>(); - } -} - -void DeleteTuples::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) - const { - non_container_child_field_names->push_back("input"); - non_container_child_fields->push_back(input_); - - if (predicate_ != nullptr) { - non_container_child_field_names->push_back("predicate"); - non_container_child_fields->push_back(predicate_); - } -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/DeleteTuples.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/DeleteTuples.hpp b/query_optimizer/physical/DeleteTuples.hpp deleted file mode 100644 index bd1e847..0000000 --- a/query_optimizer/physical/DeleteTuples.hpp +++ /dev/null @@ -1,138 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_DELETE_TUPLES_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_DELETE_TUPLES_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/expressions/Predicate.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { - -class CatalogRelation; - -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class DeleteTuples; -typedef std::shared_ptr<const DeleteTuples> DeleteTuplesPtr; - -/** - * @brief Deletes tuples on which a predicate <predicate_> is - * evaluated to true. - */ -class DeleteTuples : public Physical { - public: - PhysicalType getPhysicalType() const override { - return PhysicalType::kDeleteTuples; - } - - std::string getName() const override { return "DeleteTuples"; } - - /** - * @return The physical node that produces the relation - * where the DeleteTuples is applied. - */ - const PhysicalPtr& input() const { return input_; } - - /** - * @return The predicate used to determine whether a tuple should be deleted. - */ - const expressions::PredicatePtr& predicate() const { return predicate_; } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(getNumChildren(), new_children.size()); - return Create(new_children[0], predicate_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override { - return {}; - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override; - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - return false; - } - - /** - * @brief Creates a DeleteTuples physical node that represents an operation - * to delete tuples on which \p predicate is evaluated to true - * from the relation output by \p input. If \p predicate is NULL, - * all tuples are removed. - * - * @param input The physical node that produces the relation - * where the DeleteTuples is applied. - * @param predicate The predicate used to determine whether - * a tuple needs to be deleted. Can be NULL. - * @return An immutable DeleteTuples node. - */ - static DeleteTuplesPtr Create(const PhysicalPtr &input, - const expressions::PredicatePtr &predicate) { - return DeleteTuplesPtr(new DeleteTuples(input, predicate)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - DeleteTuples(const PhysicalPtr &input, - const expressions::PredicatePtr &predicate) - : input_(input), predicate_(predicate) { - addChild(input_); - } - - PhysicalPtr input_; - expressions::PredicatePtr predicate_; - - DISALLOW_COPY_AND_ASSIGN(DeleteTuples); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_DELETE_TUPLES_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/DropTable.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/DropTable.cpp b/query_optimizer/physical/DropTable.cpp deleted file mode 100644 index 6a4b5bd..0000000 --- a/query_optimizer/physical/DropTable.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/DropTable.hpp" - -#include <string> -#include <vector> - -#include "catalog/CatalogRelation.hpp" -#include "query_optimizer/OptimizerTree.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -void DropTable::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - inline_field_names->push_back("relation"); - inline_field_values->push_back(catalog_relation_->getName()); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/DropTable.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/DropTable.hpp b/query_optimizer/physical/DropTable.hpp deleted file mode 100644 index ef6020b..0000000 --- a/query_optimizer/physical/DropTable.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_DROPTABLE_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_DROPTABLE_HPP_ - -#include <memory> -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { - -class CatalogRelation; - -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class DropTable; -typedef std::shared_ptr<const DropTable> DropTablePtr; - -/** - * @brief Drops a table. - */ -class DropTable : public Physical { - public: - PhysicalType getPhysicalType() const override { return PhysicalType::kDropTable; } - - std::string getName() const override { return "DropTable"; } - - /** - * @return Gets the catalog relation to be dropped. - */ - const CatalogRelation* catalog_relation() const { return catalog_relation_; } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(getNumChildren(), new_children.size()); - return Create(catalog_relation_); - } - - std::vector<expressions::AttributeReferencePtr> getOutputAttributes() const override { - return {}; - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override { - return {}; - } - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override { - return false; - } - - /** - * @brief Creates a DropTable physical node that drops \p catalog_relation. - * - * @param catalog_relation The relation to be dropped. - * @return An immutable DropTable node. - */ - static DropTablePtr Create(const CatalogRelation *catalog_relation) { - return DropTablePtr(new DropTable(catalog_relation)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - explicit DropTable(const CatalogRelation *catalog_relation) - : catalog_relation_(catalog_relation) {} - - const CatalogRelation *catalog_relation_; - - DISALLOW_COPY_AND_ASSIGN(DropTable); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_DROPTABLE_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/HashJoin.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/HashJoin.cpp b/query_optimizer/physical/HashJoin.cpp deleted file mode 100644 index e186072..0000000 --- a/query_optimizer/physical/HashJoin.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/HashJoin.hpp" - -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/expressions/Predicate.hpp" -#include "utility/Cast.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -std::vector<expressions::AttributeReferencePtr> HashJoin::getReferencedAttributes() const { - std::vector<expressions::AttributeReferencePtr> referenced_attributes; - for (const expressions::NamedExpressionPtr &project_expression : - project_expressions()) { - const std::vector<expressions::AttributeReferencePtr> referenced_attributes_in_expression = - project_expression->getReferencedAttributes(); - referenced_attributes.insert(referenced_attributes.end(), - referenced_attributes_in_expression.begin(), - referenced_attributes_in_expression.end()); - } - referenced_attributes.insert(referenced_attributes.end(), - left_join_attributes_.begin(), - left_join_attributes_.end()); - referenced_attributes.insert(referenced_attributes.end(), - right_join_attributes_.begin(), - right_join_attributes_.end()); - if (residual_predicate_ != nullptr) { - const std::vector<expressions::AttributeReferencePtr> referenced_attributes_in_residual = - residual_predicate_->getReferencedAttributes(); - referenced_attributes.insert(referenced_attributes.end(), - referenced_attributes_in_residual.begin(), - referenced_attributes_in_residual.end()); - } - return referenced_attributes; -} - -bool HashJoin::maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const { - std::vector<expressions::NamedExpressionPtr> new_project_expressions; - const std::vector<expressions::NamedExpressionPtr> & - current_project_expressions = project_expressions(); - for (const expressions::NamedExpressionPtr &project_expression : - current_project_expressions) { - if (referenced_expressions.find(project_expression) != - referenced_expressions.end()) { - new_project_expressions.emplace_back(project_expression); - } - } - if (new_project_expressions.size() != current_project_expressions.size()) { - *output = Create(left(), - right(), - left_join_attributes_, - right_join_attributes_, - residual_predicate_, - new_project_expressions, - join_type_); - return true; - } - return false; -} - -void HashJoin::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - BinaryJoin::getFieldStringItems(inline_field_names, - inline_field_values, - non_container_child_field_names, - non_container_child_fields, - container_child_field_names, - container_child_fields); - if (residual_predicate_ != nullptr) { - non_container_child_field_names->push_back("residual_predicate"); - non_container_child_fields->push_back(residual_predicate_); - } - container_child_field_names->push_back("left_join_attributes"); - container_child_fields->push_back(CastSharedPtrVector<OptimizerTreeBase>(left_join_attributes_)); - container_child_field_names->push_back("right_join_attributes"); - container_child_fields->push_back(CastSharedPtrVector<OptimizerTreeBase>(right_join_attributes_)); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/HashJoin.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/HashJoin.hpp b/query_optimizer/physical/HashJoin.hpp deleted file mode 100644 index c513f77..0000000 --- a/query_optimizer/physical/HashJoin.hpp +++ /dev/null @@ -1,198 +0,0 @@ -/** - * 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_QUERY_OPTIMIZER_PHYSICAL_HASHJOIN_HPP_ -#define QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_HASHJOIN_HPP_ - -#include <cstddef> -#include <memory> -#include <string> -#include <type_traits> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" -#include "query_optimizer/expressions/AttributeReference.hpp" -#include "query_optimizer/expressions/ExpressionUtil.hpp" -#include "query_optimizer/expressions/NamedExpression.hpp" -#include "query_optimizer/expressions/Predicate.hpp" -#include "query_optimizer/physical/BinaryJoin.hpp" -#include "query_optimizer/physical/Physical.hpp" -#include "query_optimizer/physical/PhysicalType.hpp" -#include "utility/Macros.hpp" - -#include "glog/logging.h" - -namespace quickstep { -namespace optimizer { -namespace physical { - -/** \addtogroup OptimizerPhysical - * @{ - */ - -class HashJoin; -typedef std::shared_ptr<const HashJoin> HashJoinPtr; - -/** - * @brief Physical hash join node. - */ -class HashJoin : public BinaryJoin { - public: - enum class JoinType { - kInnerJoin = 0, - kLeftSemiJoin, - kLeftAntiJoin, - kLeftOuterJoin - }; - - PhysicalType getPhysicalType() const override { return PhysicalType::kHashJoin; } - - std::string getName() const override { - switch (join_type_) { - case JoinType::kInnerJoin: - return "HashJoin"; - case JoinType::kLeftSemiJoin: - return "HashLeftSemiJoin"; - case JoinType::kLeftAntiJoin: - return "HashLeftAntiJoin"; - case JoinType::kLeftOuterJoin: - return "HashLeftOuterJoin"; - default: - LOG(FATAL) << "Invalid JoinType: " - << static_cast<typename std::underlying_type<JoinType>::type>(join_type_); - } - } - - /** - * @brief Join attributes in the left logical 'left_'. - */ - const std::vector<expressions::AttributeReferencePtr>& left_join_attributes() const { - return left_join_attributes_; - } - - /** - * @brief Join attributes in the right logical 'right_'. - */ - const std::vector<expressions::AttributeReferencePtr>& right_join_attributes() const { - return right_join_attributes_; - } - - /** - * @brief The filtering predicate evaluated after join. - */ - const expressions::PredicatePtr& residual_predicate() const { - return residual_predicate_; - } - - /** - * @return Join type of this hash join. - */ - JoinType join_type() const { - return join_type_; - } - - PhysicalPtr copyWithNewChildren( - const std::vector<PhysicalPtr> &new_children) const override { - DCHECK_EQ(children().size(), new_children.size()); - return Create(new_children[0], - new_children[1], - left_join_attributes_, - right_join_attributes_, - residual_predicate_, - project_expressions(), - join_type_); - } - - std::vector<expressions::AttributeReferencePtr> getReferencedAttributes() const override; - - bool maybeCopyWithPrunedExpressions( - const expressions::UnorderedNamedExpressionSet &referenced_expressions, - PhysicalPtr *output) const override; - - /** - * @brief Creates a physical HashJoin. The left/right operand does not correspond to - * probe/build operand. - * - * @param left The left operand. - * @param right The right operand. - * @param left_join_attributes The join attributes in the 'left'. - * @param right_join_attributes The join attributes in the 'right'. - * @param residual_predicate Optional filtering predicate evaluated after join. - * @param project_expressions The project expressions. - * @param Join type of this hash join. - * @return An immutable physical HashJoin. - */ - static HashJoinPtr Create( - const PhysicalPtr &left, - const PhysicalPtr &right, - const std::vector<expressions::AttributeReferencePtr> &left_join_attributes, - const std::vector<expressions::AttributeReferencePtr> &right_join_attributes, - const expressions::PredicatePtr &residual_predicate, - const std::vector<expressions::NamedExpressionPtr> &project_expressions, - const JoinType join_type) { - return HashJoinPtr( - new HashJoin(left, - right, - left_join_attributes, - right_join_attributes, - residual_predicate, - project_expressions, - join_type)); - } - - protected: - void getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const override; - - private: - HashJoin( - const PhysicalPtr &left, - const PhysicalPtr &right, - const std::vector<expressions::AttributeReferencePtr> &left_join_attributes, - const std::vector<expressions::AttributeReferencePtr> &right_join_attributes, - const expressions::PredicatePtr &residual_predicate, - const std::vector<expressions::NamedExpressionPtr> &project_expressions, - const JoinType join_type) - : BinaryJoin(left, right, project_expressions), - left_join_attributes_(left_join_attributes), - right_join_attributes_(right_join_attributes), - residual_predicate_(residual_predicate), - join_type_(join_type) { - } - - std::vector<expressions::AttributeReferencePtr> left_join_attributes_; - std::vector<expressions::AttributeReferencePtr> right_join_attributes_; - expressions::PredicatePtr residual_predicate_; - JoinType join_type_; - - DISALLOW_COPY_AND_ASSIGN(HashJoin); -}; - -/** @} */ - -} // namespace physical -} // namespace optimizer -} // namespace quickstep - -#endif /* QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_HASHJOIN_HPP_ */ http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/156290a4/query_optimizer/physical/InsertSelection.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/physical/InsertSelection.cpp b/query_optimizer/physical/InsertSelection.cpp deleted file mode 100644 index 42a888f..0000000 --- a/query_optimizer/physical/InsertSelection.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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. - **/ - -#include "query_optimizer/physical/InsertSelection.hpp" - -#include <string> -#include <vector> - -#include "query_optimizer/OptimizerTree.hpp" - -namespace quickstep { -namespace optimizer { -namespace physical { - -void InsertSelection::getFieldStringItems( - std::vector<std::string> *inline_field_names, - std::vector<std::string> *inline_field_values, - std::vector<std::string> *non_container_child_field_names, - std::vector<OptimizerTreeBaseNodePtr> *non_container_child_fields, - std::vector<std::string> *container_child_field_names, - std::vector<std::vector<OptimizerTreeBaseNodePtr>> *container_child_fields) const { - non_container_child_field_names->push_back("destination"); - non_container_child_fields->push_back(destination_); - - non_container_child_field_names->push_back("selection"); - non_container_child_fields->push_back(selection_); -} - -} // namespace physical -} // namespace optimizer -} // namespace quickstep