[
https://issues.apache.org/jira/browse/DRILL-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15827794#comment-15827794
]
ASF GitHub Bot commented on DRILL-4956:
---------------------------------------
Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/666#discussion_r96604582
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SchemaUtilites.java
---
@@ -177,4 +186,34 @@ public static AbstractSchema
resolveToMutableDrillSchema(final SchemaPlus defaul
return drillSchema;
}
+
+ /**
+ * Looks in schema tree for default temporary workspace instance.
+ * Makes sure that temporary workspace is mutable and file-based
+ * (instance of {@link WorkspaceSchemaFactory.WorkspaceSchema}).
+ *
+ * @param defaultSchema default schema
+ * @param config drill config
+ * @return default temporary workspace
+ */
+ public static AbstractSchema getTemporaryWorkspace(SchemaPlus
defaultSchema, DrillConfig config) {
+ List<String> temporarySchemaPath =
Lists.newArrayList(config.getString(ExecConstants.DEFAULT_TEMPORARY_WORKSPACE));
+ AbstractSchema temporarySchema =
resolveToMutableDrillSchema(defaultSchema, temporarySchemaPath);
+ if (!(temporarySchema instanceof
WorkspaceSchemaFactory.WorkspaceSchema)) {
+ DrillRuntimeException.format("Temporary workspace [%s] must be
file-based, instance of " +
+ "WorkspaceSchemaFactory.WorkspaceSchema", temporarySchemaPath);
+ }
+ return temporarySchema;
+ }
+
+ /**
+ * Checks that passed schema path is the same as temporary workspace
path.
+ *
+ * @param schemaPath schema path
+ * @param config drill config
+ * @return true is schema path corresponds to temporary workspace, false
otherwise
+ */
+ public static boolean isTemporaryWorkspace(String schemaPath,
DrillConfig config) {
--- End diff --
According to Drill documentation (and Drill implementation): storage plugin
and workspace names are case-sensitive.
For example:
`use dfs.tmp` -> succeeds
`use DFS.TMP` or `use dfs.TMP` -> fails
That's why I have left check for temporary workspace case-sensitive as well.
I'll add comment that check is case-sensitive.
[1] https://drill.apache.org/docs/lexical-structure/ (Storage Plugin and
Workspace References section)
> 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: Arina Ielchiieva
> 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)