[
https://issues.apache.org/jira/browse/DRILL-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15724535#comment-15724535
]
ASF GitHub Bot commented on DRILL-4956:
---------------------------------------
Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/666#discussion_r91016062
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
---
@@ -478,10 +479,27 @@ private View getView(DotDrillFile f) throws
IOException {
return f.getView(logicalPlanPersistence);
}
+ /**
+ * Looks for table in this workspace. First check among temporary and
persistent tables.
+ * If no cached tables are found, checks if passed table name
corresponds to existing view name.
+ * If passed table name is not a view either, looks fo temporary /
persistent table name
+ * directly on file system.
+ *
+ * @param tableName original table name
+ * @return table instance of temporary / persistent table or view
+ */
@Override
public Table getTable(String tableName) {
+
+ // check temporary tables
+ String temporaryTableName =
SqlHandlerUtil.generateTemporaryTableName(tableName, schemaConfig.getUuid());
+ TableInstance temporaryTableKey = new TableInstance(new
TableSignature(temporaryTableName), ImmutableList.of());
+ if (tables.alreadyContainsKey(temporaryTableKey)) {
--- End diff --
We use the temporary table name (with uuid) as the table name in the key.
Shouldn't we use the user-defined name as the key with the internal name as
additional info? Otherwise, will the internal name "leak through" to the user
somehow? Might this somehow allow a workspace to contain both a real table Foo
and a temp table Foo_uuid?
> Temporary tables support
> ------------------------
>
> Key: DRILL-4956
> URL: https://issues.apache.org/jira/browse/DRILL-4956
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.8.0
> Reporter: Arina Ielchiieva
> Assignee: Paul Rogers
> Labels: doc-impacting
> Fix For: Future
>
>
> Link to design doc -
> https://docs.google.com/document/d/1gSRo_w6q2WR5fPx7SsQ5IaVmJXJ6xCOJfYGyqpVOC-g/edit
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)