parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tians...@apache.org
Subject git commit: Only call put() when needed in SchemaCompatibilityValidator#validateColumn()
Date Wed, 30 Jul 2014 20:49:14 GMT
Repository: incubator-parquet-mr
Updated Branches:
  refs/heads/master ad32bf0fd -> b0e26ee6f


Only call put() when needed in SchemaCompatibilityValidator#validateColumn()

This is some minor cleanup suggested by @tsdeng

Author: Alex Levenson <alexlevenson@twitter.com>

Closes #24 from isnotinvain/alexlevenson/columnTypesEncountered and squashes the following
commits:

7f05d90 [Alex Levenson] Only call put() when needed in SchemaCompatibilityValidator#validateColumn()


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

Branch: refs/heads/master
Commit: b0e26ee6f20a00a0d0769408575744c51a016018
Parents: ad32bf0
Author: Alex Levenson <alexlevenson@twitter.com>
Authored: Wed Jul 30 13:49:00 2014 -0700
Committer: Tianshuo Deng <tdeng@twitter.com>
Committed: Wed Jul 30 13:49:00 2014 -0700

----------------------------------------------------------------------
 .../parquet/filter2/predicate/SchemaCompatibilityValidator.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-parquet-mr/blob/b0e26ee6/parquet-column/src/main/java/parquet/filter2/predicate/SchemaCompatibilityValidator.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/main/java/parquet/filter2/predicate/SchemaCompatibilityValidator.java
b/parquet-column/src/main/java/parquet/filter2/predicate/SchemaCompatibilityValidator.java
index da0e122..4c43f30 100644
--- a/parquet-column/src/main/java/parquet/filter2/predicate/SchemaCompatibilityValidator.java
+++ b/parquet-column/src/main/java/parquet/filter2/predicate/SchemaCompatibilityValidator.java
@@ -152,7 +152,10 @@ public class SchemaCompatibilityValidator implements FilterPredicate.Visitor<Voi
           + " was provided with different types in the same predicate."
           + " Found both: (" + alreadySeen + ", " + column.getColumnType() + ")");
     }
-    columnTypesEncountered.put(path, column.getColumnType());
+
+    if (alreadySeen == null) {
+      columnTypesEncountered.put(path, column.getColumnType());
+    }
 
     ColumnDescriptor descriptor = getColumnDescriptor(path);
 


Mime
View raw message