You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2016/04/01 05:15:17 UTC

[2/3] incubator-kudu git commit: Change row projector schema equality check to use physical column type

Change row projector schema equality check to use physical column type

The row projector uses the column's physical type (e.g. for TIMESTAMP the
physical type is INT64) to build codegen cache keys, but used the normal column
type when comparing the projection schemas retrieved from the cache. This
resulted in spurious debug check failures.

Change-Id: I5e9a8d9c003be3942d3ce6f93d880adb45d8ded6
Reviewed-on: http://gerrit.cloudera.org:8080/2672
Reviewed-by: Todd Lipcon <to...@apache.org>
Tested-by: Kudu Jenkins
(cherry picked from commit 8f4726d83e6b6b7d76c59d06fde9231f0bb113b9)
Reviewed-on: http://gerrit.cloudera.org:8080/2682
Reviewed-by: Jean-Daniel Cryans


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/aa391149
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/aa391149
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/aa391149

Branch: refs/heads/branch-0.8.x
Commit: aa391149a4f39ff662316faffaca22c7b3783216
Parents: 2b13faf
Author: Dan Burkert <da...@cloudera.com>
Authored: Wed Mar 30 15:32:10 2016 -0700
Committer: Jean-Daniel Cryans <jd...@gerrit.cloudera.org>
Committed: Thu Mar 31 17:14:07 2016 +0000

----------------------------------------------------------------------
 src/kudu/codegen/row_projector.cc | 4 ++--
 src/kudu/common/schema.h          | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/aa391149/src/kudu/codegen/row_projector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/row_projector.cc b/src/kudu/codegen/row_projector.cc
index dd16285..d95d05a 100644
--- a/src/kudu/codegen/row_projector.cc
+++ b/src/kudu/codegen/row_projector.cc
@@ -380,7 +380,7 @@ struct DefaultEquals {
 
 struct ColumnSchemaEqualsType {
   bool operator()(const ColumnSchema& s1, const ColumnSchema& s2) {
-    return s1.EqualsType(s2);
+    return s1.EqualsPhysicalType(s2);
   }
 };
 
@@ -418,7 +418,7 @@ bool ContainerEquals(const T& t1, const T& t2) {
 // the actual dependency on column identification - which is the effect
 // that those attributes have on the RowProjector's mapping (i.e., different
 // names and IDs are ok, so long as the mapping is the same). Note that
-// key columns are not given any special meaning in projection. Types
+// key columns are not given any special meaning in projection. Physical types
 // and nullability of columns must be exactly equal between the two
 // schema pairs.
 //

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/aa391149/src/kudu/common/schema.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/schema.h b/src/kudu/common/schema.h
index 0c16c94..bebaff5 100644
--- a/src/kudu/common/schema.h
+++ b/src/kudu/common/schema.h
@@ -195,6 +195,11 @@ class ColumnSchema {
     return NULL;
   }
 
+  bool EqualsPhysicalType(const ColumnSchema& other) const {
+    return is_nullable_ == other.is_nullable_ &&
+           type_info()->physical_type() == other.type_info()->physical_type();
+  }
+
   bool EqualsType(const ColumnSchema &other) const {
     return is_nullable_ == other.is_nullable_ &&
            type_info()->type() == other.type_info()->type();
@@ -204,7 +209,7 @@ class ColumnSchema {
     if (!EqualsType(other) || this->name_ != other.name_)
       return false;
 
-    // For Key comparison checking the defauls doesn't make sense,
+    // For Key comparison checking the defaults doesn't make sense,
     // since we don't support them, for server vs user schema this comparison
     // will always fail, since the user does not specify the defaults.
     if (check_defaults) {