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

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

Github user chunhui-shi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1066#discussion_r158117382
  
    --- 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 --
    
    Could you explain why this is needed now? I think this used to work -- if a 
schema is not found under default, Drill falls back to the root to do the 
search. 
    
    What got changed thus you have to introduce this fix? 
    
    What about this test case?
    "use hbase; select t.col, t2.col2 from hbase2.t2 as t2, hbase.t as t where 
t.id = t2.id"



> 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