quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianqiao <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #73: Move hash join's probe and build node ...
Date Tue, 02 Aug 2016 00:50:48 GMT
Github user jianqiao commented on a diff in the pull request:

    --- Diff: query_optimizer/rules/SwapProbeBuild.cpp ---
    @@ -0,0 +1,72 @@
    +#include "query_optimizer/rules/SwapProbeBuild.hpp"
    +#include <cstddef>
    +#include <vector>
    +#include "query_optimizer/cost_model/StarSchemaSimpleCostModel.hpp"
    +#include "query_optimizer/expressions/AttributeReference.hpp"
    +#include "query_optimizer/physical/HashJoin.hpp"
    +#include "query_optimizer/physical/PatternMatcher.hpp"
    +#include "query_optimizer/physical/Physical.hpp"
    +#include "query_optimizer/physical/TopLevelPlan.hpp"
    +#include "query_optimizer/rules/Rule.hpp"
    +namespace quickstep {
    +namespace optimizer {
    +P::PhysicalPtr SwapProbeBuild::applyToNode(const P::PhysicalPtr &input) {
    +  P::HashJoinPtr hash_join;
    +  if (P::SomeHashJoin::MatchesWithConditionalCast(input, &hash_join)) {
    +    P::PhysicalPtr left = hash_join->left();
    +    P::PhysicalPtr right = hash_join->right();
    +    P::TopLevelPlanPtr top_level;
    +    if (P::SomeTopLevelPlan::MatchesWithConditionalCast(input, &top_level)) {
    --- End diff --
    `input` should be already a `HashJoinPtr` here due to the outer `if` statement.
    In fact, `BottomUpRule` does not provide a place for initializing `cost_model_`. One solution
is to add an `initialization()` virtual method in `class BottomUpRule`, and implement that
method in `SwapProbeBuild`.

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

View raw message