KazydubB 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_r237506645
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropTableHandler.java
##########
@@ -56,7 +57,7 @@ public DropTableHandler(SqlHandlerConfig config) {
@Override
public PhysicalPlan getPlan(SqlNode sqlNode) throws ValidationException,
RelConversionException, IOException {
SqlDropTable dropTableNode = ((SqlDropTable) sqlNode);
- String originalTableName = dropTableNode.getName();
+ String originalTableName =
FileSelection.removeLeadingSlash(dropTableNode.getName());
Review comment:
Actually, this may appear counter-intuitive for users especially when Drill
supports `SELECT` with leading slash (see
[DRILL-1130](https://issues.apache.org/jira/browse/DRILL-1130)). When a table
is created and its name does start with '/' it will be created within
workspace, i.e. will be rooted from the workspace.
You could think of it as if you performed `touch` (on Unix[-like] OS) to
create a file: `touch /${filename}` and `touch ${filename}` should create a
file in the same directory when working directory (workspace) is root ('/').
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services