[ 
https://issues.apache.org/jira/browse/DRILL-3993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300022#comment-16300022
 ] 

ASF GitHub Bot commented on DRILL-3993:
---------------------------------------

Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1066#discussion_r158260235
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java
 ---
    @@ -470,34 +576,32 @@ public void disallowTemporaryTables() {
          * @throws UserException if temporary tables usage is disallowed
          */
         @Override
    -    public RelOptTableImpl getTable(final List<String> names) {
    -      RelOptTableImpl temporaryTable = null;
    -
    -      if (mightBeTemporaryTable(names, session.getDefaultSchemaPath(), 
drillConfig)) {
    -        String temporaryTableName = 
session.resolveTemporaryTableName(names.get(names.size() - 1));
    -        if (temporaryTableName != null) {
    -          List<String> temporaryNames = 
Lists.newArrayList(temporarySchema, temporaryTableName);
    -          temporaryTable = super.getTable(temporaryNames);
    +    public Prepare.PreparingTable getTable(final List<String> names) {
    +      String originalTableName = 
session.getOriginalTableNameFromTemporaryTable(names.get(names.size() - 1));
    +      if (originalTableName != null) {
    +        if (!allowTemporaryTables) {
    +          throw UserException
    +              .validationError()
    +              .message("Temporary tables usage is disallowed. Used 
temporary table name: [%s].", originalTableName)
    +              .build(logger);
             }
           }
    -      if (temporaryTable != null) {
    -        if (allowTemporaryTables) {
    -          return temporaryTable;
    +      // Fix for select from hbase table with schema name in query 
(example: "SELECT col FROM hbase.t)
    +      // from hbase schema (did "USE hbase" before).
    --- End diff --
    
    This change was made before the change, where we catch and log exceptions 
from `HBaseSchema.getTable()` method. So yes, it is not needed now.


> Rebase Drill on Calcite master branch
> -------------------------------------
>
>                 Key: DRILL-3993
>                 URL: https://issues.apache.org/jira/browse/DRILL-3993
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.2.0
>            Reporter: Sudheesh Katkam
>            Assignee: Roman Kulyk
>
> Calcite keeps moving, and now we need to catch up to Calcite 1.5, and ensure 
> there are no regressions.
> Also, how do we resolve this 'catching up' issue in the long term?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to