[GitHub] incubator-quickstep pull request #326: QUICKSTEP-112 Get the list of referen...
Github user asfgit closed the pull request at: https://github.com/apache/incubator-quickstep/pull/326 ---
[GitHub] incubator-quickstep pull request #326: QUICKSTEP-112 Get the list of referen...
Github user jianqiao commented on a diff in the pull request: https://github.com/apache/incubator-quickstep/pull/326#discussion_r154230379 --- Diff: query_optimizer/rules/ReferencedBaseRelations.hpp --- @@ -0,0 +1,78 @@ +/** + * 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_RULES_REFERENCED_BASE_RELATIONS_HPP_ +#define QUICKSTEP_QUERY_OPTIMIZER_RULES_REFERENCED_BASE_RELATIONS_HPP_ + +#include +#include + +#include "catalog/CatalogTypedefs.hpp" +#include "query_optimizer/logical/Logical.hpp" +#include "query_optimizer/rules/DFSTraversal.hpp" +#include "utility/Macros.hpp" + +namespace quickstep { + +class CatalogRelation; + +namespace optimizer { + +class OptimizerContext; + +class ReferencedBaseRelations : public DFSTraversal { --- End diff -- Since this class overrides the `apply` method, we can just inherit `Rule`. ---
[GitHub] incubator-quickstep pull request #326: QUICKSTEP-112 Get the list of referen...
Github user jianqiao commented on a diff in the pull request: https://github.com/apache/incubator-quickstep/pull/326#discussion_r154229622 --- Diff: query_optimizer/rules/ReferencedBaseRelations.hpp --- @@ -0,0 +1,78 @@ +/** + * 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_RULES_REFERENCED_BASE_RELATIONS_HPP_ +#define QUICKSTEP_QUERY_OPTIMIZER_RULES_REFERENCED_BASE_RELATIONS_HPP_ + +#include +#include + +#include "catalog/CatalogTypedefs.hpp" +#include "query_optimizer/logical/Logical.hpp" +#include "query_optimizer/rules/DFSTraversal.hpp" +#include "utility/Macros.hpp" + +namespace quickstep { + +class CatalogRelation; + +namespace optimizer { + +class OptimizerContext; + +class ReferencedBaseRelations : public DFSTraversal { + public: + /** + * @brief Constructor + * @param optimizer_context The optimizer context. + */ + explicit ReferencedBaseRelations(OptimizerContext *optimizer_context) + : optimizer_context_(optimizer_context) { + } + + std::string getName() const override { return "ReferencedBaseRelations"; } + + TreeNodePtr apply(const TreeNodePtr ) override; + + /** + * @brief Get the base relations referenced in a query. + */ + const std::vector getReferencedBaseRelations() const { --- End diff -- Better remove the beginning `const`, as the method returns a temporary object. ---
[GitHub] incubator-quickstep pull request #326: QUICKSTEP-112 Get the list of referen...
GitHub user hbdeshmukh opened a pull request: https://github.com/apache/incubator-quickstep/pull/326 QUICKSTEP-112 Get the list of referenced base relations - Find the base relations that are referenced in a query. - The referenced relations are stored in the QueryHandle. - Separate method to just get this list of relations, without needing to fully optimize the query. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hbdeshmukh/incubator-quickstep get-referenced-base-relations Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-quickstep/pull/326.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #326 commit d773ee8774d5b56eec30002a7d06b3b39d885efb Author: Harshad DeshmukhDate: 2017-11-28T22:16:59Z Get the list of referenced base relations - Find the base relations that are referenced in the query. - The referenced relations are stored in the QueryHandle. - Separate method to just get this list of relations, without needing to fully optimize the query. ---