Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/736#discussion_r99393786
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java
---
@@ -527,5 +529,31 @@ public RelOptTableImpl getTable(final List<String>
names) {
}
return super.getTable(names);
}
+
+ /**
+ * Check if passed table is temporary or not should be done if:
+ * <li>schema is not indicated (only one element in the names
list)<li/>
+ * <li>current schema or indicated schema is default temporary
workspace<li/>
+ *
+ * Examples (where dfs.tmp is default temporary workspace):
+ * <li>select * from t<li/>
+ * <li>select * from dfs.tmp.t<li/>
+ * <li>use dfs; select * from tmp.t<li/>
+ *
+ * @param names list of schema and table names, table name
is always the last element
+ * @param defaultSchemaPath current schema path set using USE command
+ * @param drillConfig drill config
+ * @return true if check for temporary table should be done, false
otherwise
+ */
+ private boolean checkForTemporaryTable(List<String> names, String
defaultSchemaPath, DrillConfig drillConfig) {
+ if (names.size() == 1) {
+ return true;
+ }
--- End diff --
Renamed method to `mightBeTemporaryTable`. You are right the intent here is
just to filter out cases when we don't need to check is passed table might be
temporary. When table is passed to `getTableName` we don't know if it's
temporary or not. If it is temporary we need to substitute the name to
generated one and there are several indicators when we need to check this:
table name is without schema or indicated schema is default temporary
workspace,in all other cases we just check regular tables directly.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---