public ASTNode parseTriggerExpression(String command) throws ParseException { HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_ResourcePlanParser.triggerExpressionStandalone_return r = null; try { r = parser.gResourcePlanParser.triggerExpressionStandalone(); } catch (RecognitionException e) { throw new ParseException(parser.errors); } if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else if (parser.errors.size() != 0) { throw new ParseException(parser.errors); } return r.getTree(); }
public ASTNode parseHint(String command) throws ParseException { LOG.debug("Parsing hint: {}", command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HintParser parser = new HintParser(tokens); parser.setTreeAdaptor(adaptor); HintParser.hint_return r = null; try { r = parser.hint(); } catch (RecognitionException e) { throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); }
public ASTNode parseExpression(String command) throws ParseException { LOG.debug("Parsing expression: {}", command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_IdentifiersParser.expression_return r = null; try { r = parser.expression(); } catch (RecognitionException e) { throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); }
public ASTNode parseTriggerActionExpression(String command) throws ParseException { HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_ResourcePlanParser.triggerActionExpressionStandalone_return r = null; try { r = parser.gResourcePlanParser.triggerActionExpressionStandalone(); } catch (RecognitionException e) { throw new ParseException(parser.errors); } if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else if (parser.errors.size() != 0) { throw new ParseException(parser.errors); } return r.getTree(); } }
public ASTNode parseSelect(String command, Context ctx) throws ParseException { LOG.debug("Parsing command: {}", command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); if (ctx != null) { ctx.setTokenRewriteStream(tokens); } HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_SelectClauseParser.selectClause_return r = null; try { r = parser.selectClause(); } catch (RecognitionException e) { throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return r.getTree(); } public ASTNode parseExpression(String command) throws ParseException {
public ASTNode parseHint(String command) throws ParseException { LOG.info("Parsing hint: " + command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HintParser parser = new HintParser(tokens); parser.setTreeAdaptor(adaptor); HintParser.hint_return r = null; try { r = parser.hint(); } catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.info("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); }
public ASTNode parseExpression(String command) throws ParseException { LOG.info("Parsing expression: " + command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_IdentifiersParser.expression_return r = null; try { r = parser.expression(); } catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.info("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); } }
public ASTNode parseSelect(String command, Context ctx) throws ParseException { if (LOG.isDebugEnabled()) { LOG.debug("Parsing command: " + command); } HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); if (ctx != null) { ctx.setTokenRewriteStream(tokens); } HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_SelectClauseParser.selectClause_return r = null; try { r = parser.selectClause(); } catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); } public ASTNode parseExpression(String command) throws ParseException {
r = parser.statement(); } catch (RecognitionException e) { throw new ParseException(parser.errors); LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors);
} catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); LOG.debug("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors);
public ASTNode parseSelect(String command, Context ctx) throws ParseException { LOG.info("Parsing command: " + command); HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command)); TokenRewriteStream tokens = new TokenRewriteStream(lexer); if (ctx != null) { ctx.setTokenRewriteStream(tokens); } HiveParser parser = new HiveParser(tokens); parser.setTreeAdaptor(adaptor); HiveParser_SelectClauseParser.selectClause_return r = null; try { r = parser.selectClause(); } catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); } if (lexer.getErrors().size() == 0 && parser.errors.size() == 0) { LOG.info("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors); } return (ASTNode) r.getTree(); } }
r = parser.statement(); } catch (RecognitionException e) { throw new ParseException(parser.getErrors()); LOG.info("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.getErrors());
} catch (RecognitionException e) { e.printStackTrace(); throw new ParseException(parser.errors); LOG.info("Parse Completed"); } else if (lexer.getErrors().size() != 0) { throw new ParseException(lexer.getErrors()); } else { throw new ParseException(parser.errors);