drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject drill git commit: DRILL-4449: Wrong results when metadata cache is used with specific set of queries
Date Fri, 04 Mar 2016 23:40:10 GMT
Repository: drill
Updated Branches:
  refs/heads/master edea8b1cf -> de2d062a6


DRILL-4449: Wrong results when metadata cache is used with specific set of queries

close apache/drill#392


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

Branch: refs/heads/master
Commit: de2d062a6a5f4077bfaa254e170ecdbb7fa0dc8d
Parents: edea8b1
Author: adeneche <adeneche@gmail.com>
Authored: Wed Feb 24 19:19:09 2016 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Fri Mar 4 15:33:35 2016 -0800

----------------------------------------------------------------------
 .../drill/exec/store/parquet/Metadata.java       | 19 +++++++++++++++++--
 .../exec/store/parquet/ParquetGroupScan.java     |  6 ++++--
 2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/de2d062a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
index 25b93b7..952f379 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java
@@ -493,6 +493,8 @@ public class Metadata {
     @JsonIgnore public abstract PrimitiveTypeName getPrimitiveType(String[] columnName);
 
     @JsonIgnore public abstract OriginalType getOriginalType(String[] columnName);
+
+    @JsonIgnore public abstract ParquetTableMetadataBase clone();
   }
 
   public static abstract class ParquetFileMetadata {
@@ -542,8 +544,7 @@ public class Metadata {
       super();
     }
 
-    public ParquetTableMetadata_v1(ParquetTableMetadataBase p, List<ParquetFileMetadata_v1>
files,
-        List<String> directories) {
+    public ParquetTableMetadata_v1(List<ParquetFileMetadata_v1> files, List<String>
directories) {
       this.files = files;
       this.directories = directories;
     }
@@ -571,6 +572,10 @@ public class Metadata {
     @JsonIgnore @Override public OriginalType getOriginalType(String[] columnName) {
       return null;
     }
+
+    @JsonIgnore @Override public ParquetTableMetadataBase clone() {
+      return new ParquetTableMetadata_v1(files, directories);
+    }
   }
 
 
@@ -787,6 +792,13 @@ public class Metadata {
       this.columnTypeInfo = ((ParquetTableMetadata_v2) parquetTable).columnTypeInfo;
     }
 
+    public ParquetTableMetadata_v2(List<ParquetFileMetadata_v2> files, List<String>
directories,
+        ConcurrentHashMap<ColumnTypeMetadata_v2.Key, ColumnTypeMetadata_v2> columnTypeInfo)
{
+      this.files = files;
+      this.directories = directories;
+      this.columnTypeInfo = columnTypeInfo;
+    }
+
     public ColumnTypeMetadata_v2 getColumnTypeInfo(String[] name) {
       return columnTypeInfo.get(new ColumnTypeMetadata_v2.Key(name));
     }
@@ -815,6 +827,9 @@ public class Metadata {
       return getColumnTypeInfo(columnName).originalType;
     }
 
+    @JsonIgnore @Override public ParquetTableMetadataBase clone() {
+      return new ParquetTableMetadata_v2(files, directories, columnTypeInfo);
+    }
   }
 
 

http://git-wip-us.apache.org/repos/asf/drill/blob/de2d062a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
index b8ae92c..ccfca41 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
@@ -712,8 +712,10 @@ public class ParquetGroupScan extends AbstractFileGroupScan {
         newFileMetadataList.add(file);
       }
     }
-    parquetTableMetadata.assignFiles(newFileMetadataList);
-    return parquetTableMetadata;
+
+    ParquetTableMetadataBase metadata = parquetTableMetadata.clone();
+    metadata.assignFiles(newFileMetadataList);
+    return metadata;
   }
 
   /**


Mime
View raw message