You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Lin Liu <ll...@gmail.com> on 2014/07/25 00:17:30 UTC

AST to Query Sring

Hi folks,

Currently I am working on a project which needs to generate query string
based on the modified AST.
Does Hive contain this mechanism already?
If not, which tools would help to complete the task?

Thanks in advance.

Lin

Re: AST to Query Sring

Posted by Lin Liu <ll...@gmail.com>.
Hi Navis,

Thanks for your suggestions.
This is a good starting point.

Thanks,
Lin


On Thu, Jul 24, 2014 at 6:00 PM, Navis류승우 <na...@nexr.com> wrote:

> You need TokenRewriteStream for the ASTNode. which is in Context or
> ParseDriver.
>
> String rewrite(TokenRewriteStream rewriter, ASTNode source) throws
> Exception {
>   // some modification..
>   return rewriter.toString(source.getTokenStartIndex(),
> source.getTokenStopIndex());
> }
>
> Thanks,
> Navis
>
>
> 2014-07-25 7:17 GMT+09:00 Lin Liu <ll...@gmail.com>:
>
> > Hi folks,
> >
> > Currently I am working on a project which needs to generate query string
> > based on the modified AST.
> > Does Hive contain this mechanism already?
> > If not, which tools would help to complete the task?
> >
> > Thanks in advance.
> >
> > Lin
> >
>

Re: AST to Query Sring

Posted by Navis류승우 <na...@nexr.com>.
You need TokenRewriteStream for the ASTNode. which is in Context or
ParseDriver.

String rewrite(TokenRewriteStream rewriter, ASTNode source) throws
Exception {
  // some modification..
  return rewriter.toString(source.getTokenStartIndex(),
source.getTokenStopIndex());
}

Thanks,
Navis


2014-07-25 7:17 GMT+09:00 Lin Liu <ll...@gmail.com>:

> Hi folks,
>
> Currently I am working on a project which needs to generate query string
> based on the modified AST.
> Does Hive contain this mechanism already?
> If not, which tools would help to complete the task?
>
> Thanks in advance.
>
> Lin
>