drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject [3/4] drill git commit: DRILL-4511: Add unit tests for "Table does not exist" situation in case of empty directory or incorrect table name
Date Fri, 21 Jul 2017 13:30:51 GMT
DRILL-4511: Add unit tests for "Table does not exist" situation in case of empty directory
or incorrect table name

closes #869


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

Branch: refs/heads/master
Commit: 4e5a0cb96f7fc0c725bd4e5b5aac1342170531ae
Parents: 34d736e
Author: Roman Kulyk <rom.kulyk@gmail.com>
Authored: Thu Jul 6 18:27:34 2017 +0300
Committer: Arina Ielchiieva <arina.yelchiyeva@gmail.com>
Committed: Fri Jul 21 15:48:13 2017 +0300

----------------------------------------------------------------------
 .../store/parquet/TestParquetMetadataCache.java | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/4e5a0cb9/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 dff2e86..edb3bd8 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
@@ -207,6 +207,34 @@ public class TestParquetMetadataCache extends PlanTestBase {
         .go();
   }
 
+  @Test //DRILL-4511
+  public void testTableDoesNotExistWithEmptyDirectory() throws Exception {
+    File path = new File(getTempDir("empty_directory"));
+    String pathString = path.toURI().getPath();
+    try {
+      path.mkdir();
+      testBuilder()
+          .sqlQuery("refresh table metadata dfs.`%s`", pathString)
+          .unOrdered()
+          .baselineColumns("ok", "summary")
+          .baselineValues(false, String.format("Table %s does not exist.", pathString))
+          .go();
+    } finally {
+      FileUtils.deleteQuietly(path);
+    }
+  }
+
+  @Test //DRILL-4511
+  public void testTableDoesNotExistWithIncorrectTableName() throws Exception {
+    String tableName = "incorrect_table";
+    testBuilder()
+        .sqlQuery("refresh table metadata dfs.`%s`", tableName)
+        .unOrdered()
+        .baselineColumns("ok", "summary")
+        .baselineValues(false, String.format("Table %s does not exist.", tableName))
+        .go();
+  }
+
   @Test
   public void testNoSupportedError() throws Exception {
     testBuilder()


Mime
View raw message