[ 
https://issues.apache.org/jira/browse/DRILL-6863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16703435#comment-16703435
 ] 

ASF GitHub Bot commented on DRILL-6863:
---------------------------------------

vdiravka commented on a change in pull request #1557: DRILL-6863: Drop table is 
not working if path within workspace starts…
URL: https://github.com/apache/drill/pull/1557#discussion_r237552734
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestViewSupport.java
 ##########
 @@ -751,4 +751,53 @@ public void selectFromViewCreatedOnCalcite1_4() throws 
Exception {
         .baselineValues("HeadQuarters")
         .go();
   }
+
+  @Test
+  public void testDropViewNameStartsWithSlash() throws Exception {
+    String viewName = "views/tmp_view";
+    try {
+      test("CREATE VIEW `%s`.`%s` AS SELECT * FROM cp.`region.json`", 
DFS_TMP_SCHEMA, viewName);
+      testBuilder()
+          .sqlQuery("DROP VIEW `%s`.`%s`", DFS_TMP_SCHEMA, "/" + viewName)
+          .unOrdered()
+          .baselineColumns("ok", "summary")
+          .baselineValues(true,
+              String.format("View [%s] deleted successfully from schema 
[%s].", viewName, DFS_TMP_SCHEMA))
+          .go();
+    } finally {
+      test("DROP VIEW IF EXISTS `%s`.`%s`", DFS_TMP_SCHEMA, viewName);
+    }
+  }
+
+  @Test
+  public void testViewIsCreatedWithinWorkspace() throws Exception {
+    String viewName = "views/tmp_view";
+    try {
+      test("CREATE VIEW `%s`.`%s` AS SELECT * FROM cp.`region.json`", 
DFS_TMP_SCHEMA, "/" + viewName);
+      testBuilder()
+          .sqlQuery("SELECT region_id FROM `%s`.`%s` LIMIT 1", DFS_TMP_SCHEMA, 
viewName)
+          .unOrdered()
+          .baselineColumns("region_id")
+          .baselineValues(0L)
+          .go();
+    } finally {
+      test("DROP VIEW IF EXISTS `%s`.`%s`", DFS_TMP_SCHEMA, viewName);
+    }
+  }
+
+  @Test
+  public void testViewIsFoundWithinWorkspaceWhenNameStartsWithSlash() throws 
Exception {
 
 Review comment:
   It's fine

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Drop table is not working if path within workspace starts with '/'
> ------------------------------------------------------------------
>
>                 Key: DRILL-6863
>                 URL: https://issues.apache.org/jira/browse/DRILL-6863
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.15.0
>            Reporter: Denys Ordynskiy
>            Assignee: Bohdan Kazydub
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.15.0
>
>
> Drill works incorrectly if path to the table within workspace starts with '/'
> Request "drop table s3.tmp.`drill/transitive_closure/tab1`" works fine,
>  but if I add '/' in the begining of the tables path "drop table 
> s3.tmp.`{color:#d04437}/{color}drill/transitive_closure/tab1`", Drill is 
> trying to find table in the root directory but not in workspace path.
> *Actual result:*
>  Drill returns successfully response
>  "Table [/drill/transitive_closure/tab1] dropped"
>  but table was not dropped.
>  
> *Expected result:*
> Table was droped.
> Bug can be reproduced on S3 and DFS storages. On FileSystem storage Drill 
> successfully returns error message if "drop table" query starts with '/' in 
> table path.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to