You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by am...@apache.org on 2015/10/02 00:00:02 UTC
[3/4] drill git commit: DRILL-3817: Disable rewriting compound
identifier for refresh metadata query
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 <me...@gmail.com>
Authored: Tue Sep 22 13:09:51 2015 -0700
Committer: Aman Sinha <as...@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);