Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.10.0
-
None
-
None
-
Windows 10
Description
Problem 1:
Error occurs when attempting to create temporary table on Windows:
0: jdbc:drill:zk=local> create temporary table t as select * from sys.version; Error: SYSTEM ERROR: InvalidPathException: Illegal char <:> at index 4: file:///\tmp\3191db8e-279d-4ced-b0e5-32b3b477edfb
Root cause:
when creating temporary directory we merge file system uri, temporary workspace location and session id into one path using java.nio.file.Paths.get() but this method cannot resolve path when path has different delimiters.
Fix:
Use org.apache.hadoop.fs.Path tools to merge path, path string is normalized during creation.
new Path(fs.getUri().toString(), new Path(temporaryWorkspace.getDefaultLocation(), sessionId));
Problem 2:
When temporary table is being manually dropped using drop table command, though actual table is dropped, remnant folder is left.
Root cause:
Before adding to temporary table to the list of temporary tables, its generated name is concatenated with session id (as parent and child folders). java.nio.file.Paths.get() is used for concatenation but it preserves current system delimiter. When table is being dropped, passed table name is split using org.apache.hadoop.fs.Path.SEPARATOR, since it's assumed that path was created using org.apache.hadoop.fs.Path tools where path separators are normalized to one format disregarding the system.
Fix:
Concatenate session id with generated table name using org.apache.hadoop.fs.Path tools.
new Path(sessionId, UUID.randomUUID().toString()).toUri().getPath();
Attachments
Issue Links
- links to