drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [3/4] drill git commit: DRILL-3817: Disable rewriting compound identifier for refresh metadata query
Date Thu, 01 Oct 2015 22:00:02 GMT
DRILL-3817: Disable rewriting compound identifier for refresh metadata query


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

Branch: refs/heads/master
Commit: f9cefd5e7b2de52812ac6a0813237479d9a6a167
Parents: f01da3e
Author: Mehant Baid <mehantr@gmail.com>
Authored: Tue Sep 22 13:09:51 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Thu Oct 1 14:55:04 2015 -0700

----------------------------------------------------------------------
 .../planner/sql/parser/CompoundIdentifierConverter.java   |  1 +
 .../exec/store/parquet/TestParquetMetadataCache.java      | 10 ++++++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/f9cefd5e/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
index ebe6d39..3e4c59c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/CompoundIdentifierConverter.java
@@ -161,6 +161,7 @@ public class CompoundIdentifierConverter extends SqlShuttle {
     rules.put(SqlJoin.class, R(D, D, D, D, D, E));
     rules.put(SqlOrderBy.class, R(D, E, D, D));
     rules.put(SqlDropTable.class, R(D));
+    rules.put(SqlRefreshMetadata.class, R(D));
     REWRITE_RULES = ImmutableMap.copyOf(rules);
   }
 

http://git-wip-us.apache.org/repos/asf/drill/blob/f9cefd5e/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetMetadataCache.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetMetadataCache.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetMetadataCache.java
index ccaa9e7..5a88cf9 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetMetadataCache.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetMetadataCache.java
@@ -54,6 +54,16 @@ public class TestParquetMetadataCache extends BaseTestQuery {
     Assert.assertEquals(50, rowCount);
   }
 
+  @Test
+  public void testCacheWithSubschema() throws Exception {
+    String tableName = "nation_ctas_subschema";
+    test(String.format("create table dfs_test.tmp.`%s/t1` as select * from cp.`tpch/nation.parquet`",
tableName));
+    test(String.format("refresh table metadata dfs_test.tmp.%s", tableName));
+    checkForMetadataFile(tableName);
+    int rowCount = testSql(String.format("select * from dfs_test.tmp.%s", tableName));
+    Assert.assertEquals(25, rowCount);
+  }
+
   private void checkForMetadataFile(String table) throws Exception {
     String tmpDir = getDfsTestTmpSchemaLocation();
     String metaFile = Joiner.on("/").join(tmpDir, table, Metadata.METADATA_FILENAME);


Mime
View raw message