hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reuben (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-10190) CBO: AST mode checks for TABLESAMPLE with AST.toString().contains("TOK_TABLESPLITSAMPLE")
Date Thu, 09 Apr 2015 12:10:14 GMT

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

Reuben commented on HIVE-10190:
-------------------------------

Right, which is is why in my code, I was using the {{Set<T>.contains}} rather than {{String.contains}}.
Also, the patch as is won't work because:

{code}
      for (Node child : current.getChildren()) {
        fringe.add((ASTNode) child);
      }
{code}

will fail if current doesn't have any children. 

Lastly, this is my first patch, so uh ... if I could maybe get some help on how to commit
it .. that would be cool too : ).

> CBO: AST mode checks for TABLESAMPLE with AST.toString().contains("TOK_TABLESPLITSAMPLE")
> -----------------------------------------------------------------------------------------
>
>                 Key: HIVE-10190
>                 URL: https://issues.apache.org/jira/browse/HIVE-10190
>             Project: Hive
>          Issue Type: Bug
>          Components: CBO
>    Affects Versions: 1.2.0
>            Reporter: Gopal V
>            Assignee: Pengcheng Xiong
>            Priority: Trivial
>              Labels: perfomance
>         Attachments: HIVE-10190-querygen.py, HIVE-10190.01.patch
>
>
> {code}
> public static boolean validateASTForUnsupportedTokens(ASTNode ast) {
>     String astTree = ast.toStringTree();
>     // if any of following tokens are present in AST, bail out
>     String[] tokens = { "TOK_CHARSETLITERAL", "TOK_TABLESPLITSAMPLE" };
>     for (String token : tokens) {
>       if (astTree.contains(token)) {
>         return false;
>       }
>     }
>     return true;
>   }
> {code}
> This is an issue for a SQL query which is bigger in AST form than in text (~700kb).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message