Minor fixes to getName() for comparisons (#166) Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/6dba6e1e Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/6dba6e1e Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/6dba6e1e
Branch: refs/heads/master Commit: 6dba6e1e0c7e91a058340569b9a2cf5bb1d995e6 Parents: 476f0ac Author: Jianqiao Zhu <[email protected]> Authored: Thu Apr 14 22:23:09 2016 -0500 Committer: Jignesh Patel <[email protected]> Committed: Thu Apr 14 22:23:09 2016 -0500 ---------------------------------------------------------------------- parser/tests/TPCH.test | 4 ++-- .../expressions/ComparisonExpression.cpp | 19 +++---------------- types/operations/comparisons/ComparisonID.cpp | 10 ++++++---- 3 files changed, 11 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6dba6e1e/parser/tests/TPCH.test ---------------------------------------------------------------------- diff --git a/parser/tests/TPCH.test b/parser/tests/TPCH.test index af300a4..45071e4 100644 --- a/parser/tests/TPCH.test +++ b/parser/tests/TPCH.test @@ -803,7 +803,7 @@ SelectStatement | +-Equal | | +-left_operand=AttributeReference[attribute_name=s_nationkey] | | +-right_operand=AttributeReference[attribute_name=n_nationkey] - | +-kLike + | +-Like | +-left_operand=AttributeReference[attribute_name=p_name] | +-right_operand=Literal | +-StringLiteral[value=%ghost%] @@ -1045,7 +1045,7 @@ SelectStatement | | | +-NumericLiteral[numeric_string=0,float_like=false] | | +-when_clauses= | | +-SearchedWhenClause - | | +-condition_predicate=kLike + | | +-condition_predicate=Like | | | +-left_operand=AttributeReference[attribute_name=p_type] | | | +-right_operand=Literal | | | +-StringLiteral[value=PROMO%] http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6dba6e1e/query_optimizer/expressions/ComparisonExpression.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/expressions/ComparisonExpression.cpp b/query_optimizer/expressions/ComparisonExpression.cpp index e88fc4d..5cebf8b 100644 --- a/query_optimizer/expressions/ComparisonExpression.cpp +++ b/query_optimizer/expressions/ComparisonExpression.cpp @@ -1,6 +1,8 @@ /** * Copyright 2011-2015 Quickstep Technologies LLC. * Copyright 2015 Pivotal Software, Inc. + * Copyright 2016, Quickstep Research Group, Computer Sciences Department, + * University of WisconsinâMadison. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,22 +50,7 @@ ComparisonExpression::ComparisonExpression(const Comparison &comparison, } std::string ComparisonExpression::getName() const { - switch (comparison_.getComparisonID()) { - case ComparisonID::kEqual: - return "Equal"; - case ComparisonID::kNotEqual: - return "NotEqual"; - case ComparisonID::kLess: - return "Less"; - case ComparisonID::kLessOrEqual: - return "LessOrEqual"; - case ComparisonID::kGreater: - return "Greater"; - case ComparisonID::kGreaterOrEqual: - return "GreaterOrEqual"; - default: - LOG(FATAL) << "Unknown comparison type"; - } + return comparison_.getName(); } bool ComparisonExpression::isEqualityComparisonPredicate() const { http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6dba6e1e/types/operations/comparisons/ComparisonID.cpp ---------------------------------------------------------------------- diff --git a/types/operations/comparisons/ComparisonID.cpp b/types/operations/comparisons/ComparisonID.cpp index be6f4ea..5fa3b83 100644 --- a/types/operations/comparisons/ComparisonID.cpp +++ b/types/operations/comparisons/ComparisonID.cpp @@ -1,6 +1,8 @@ /** * Copyright 2011-2015 Quickstep Technologies LLC. * Copyright 2015 Pivotal Software, Inc. + * Copyright 2016, Quickstep Research Group, Computer Sciences Department, + * University of WisconsinâMadison. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,10 +28,10 @@ const char *kComparisonNames[] = { "LessOrEqual", "Greater", "GreaterOrEqual", - "kLike", - "kNotLike", - "kRegexMatch", - "kNotRegexMatch" + "Like", + "NotLike", + "RegexMatch", + "NotRegexMatch" }; const char *kComparisonShortNames[] = {
