public String getAstStringTree() { if (astStringTree == null) { astStringTree = astTree.dump(); } return astStringTree; }
public String dump() { StringBuilder sb = new StringBuilder("\n"); dump(sb); return sb.toString(); }
public String dump() { StringBuilder sb = new StringBuilder("\n"); dump(sb); return sb.toString(); }
@Override public void analyzeInternal(ASTNode ast) throws SemanticException { if (ast.getToken().getType() == HiveParser.TOK_CREATEMACRO) { LOG.debug("Analyzing create macro " + ast.dump()); analyzeCreateMacro(ast); } if (ast.getToken().getType() == HiveParser.TOK_DROPMACRO) { LOG.debug("Analyzing drop macro " + ast.dump()); analyzeDropMacro(ast); } }
@Override public void analyzeInternal(ASTNode ast) throws SemanticException { if (ast.getToken().getType() == HiveParser.TOK_CREATEMACRO) { LOG.debug("Analyzing create macro " + ast.dump()); analyzeCreateMacro(ast); } if (ast.getToken().getType() == HiveParser.TOK_DROPMACRO) { LOG.debug("Analyzing drop macro " + ast.dump()); analyzeDropMacro(ast); } }
ASTNode reAnalyzeCTASAfterCbo(ASTNode newAst) throws SemanticException { // analyzeCreateTable uses this.ast, but doPhase1 doesn't, so only reset it // here. newAst = analyzeCreateTable(newAst, getQB(), null); if (newAst == null) { LOG.error("analyzeCreateTable failed to initialize CTAS after CBO;" + " new ast is " + getAST().dump()); throw new SemanticException("analyzeCreateTable failed to initialize CTAS after CBO"); } return newAst; }
ASTNode reAnalyzeViewAfterCbo(ASTNode newAst) throws SemanticException { // analyzeCreateView uses this.ast, but doPhase1 doesn't, so only reset it // here. newAst = analyzeCreateView(newAst, getQB(), null); if (newAst == null) { LOG.error("analyzeCreateTable failed to initialize materialized view after CBO;" + " new ast is " + getAST().dump()); throw new SemanticException("analyzeCreateTable failed to initialize materialized view after CBO"); } return newAst; }
ASTNode reAnalyzeViewAfterCbo(ASTNode newAst) throws SemanticException { // analyzeCreateView uses this.ast, but doPhase1 doesn't, so only reset it // here. newAst = analyzeCreateView(newAst, getQB(), null); if (newAst == null) { LOG.error("analyzeCreateTable failed to initialize materialized view after CBO;" + " new ast is " + getAST().dump()); throw new SemanticException("analyzeCreateTable failed to initialize materialized view after CBO"); } return newAst; }
ASTNode reAnalyzeCTASAfterCbo(ASTNode newAst) throws SemanticException { // analyzeCreateTable uses this.ast, but doPhase1 doesn't, so only reset it // here. newAst = analyzeCreateTable(newAst, getQB(), null); if (newAst == null) { LOG.error("analyzeCreateTable failed to initialize CTAS after CBO;" + " new ast is " + getAST().dump()); throw new SemanticException("analyzeCreateTable failed to initialize CTAS after CBO"); } return newAst; }
HiveParser.TOK_INSERT, HiveParser.TOK_DESTINATION); if (newDest == null) { LOG.error("Cannot find destination after CBO; new ast is " + newAst.dump()); throw new SemanticException("Cannot find destination after CBO");
HiveParser.TOK_INSERT, HiveParser.TOK_DESTINATION); if (newDest == null) { LOG.error("Cannot find destination after CBO; new ast is " + newAst.dump()); throw new SemanticException("Cannot find destination after CBO");
@Test public void parseInterval() throws Exception { ASTNode root = parseDriver.parse(query); assertNotNull("failed: " + query, findFunctionNode(root)); System.out.println(root.dump()); }
private void analyzeSetShowRole(ASTNode ast) throws SemanticException { switch (ast.getChildCount()) { case 0: ctx.setResFile(ctx.getLocalTmpPath()); rootTasks.add(hiveAuthorizationTaskFactory.createShowCurrentRoleTask( getInputs(), getOutputs(), ctx.getResFile())); setFetchTask(createFetchTask(RoleDDLDesc.getRoleNameSchema())); break; case 1: rootTasks.add(hiveAuthorizationTaskFactory.createSetRoleTask( BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), getInputs(), getOutputs())); break; default: throw new SemanticException("Internal error. ASTNode expected to have 0 or 1 child. " + ast.dump()); } }
private void analyzeSetShowRole(ASTNode ast) throws SemanticException { switch (ast.getChildCount()) { case 0: ctx.setResFile(ctx.getLocalTmpPath()); rootTasks.add(hiveAuthorizationTaskFactory.createShowCurrentRoleTask( getInputs(), getOutputs(), ctx.getResFile())); setFetchTask(createFetchTask(RoleDDLDesc.getRoleNameSchema())); break; case 1: rootTasks.add(hiveAuthorizationTaskFactory.createSetRoleTask( BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), getInputs(), getOutputs())); break; default: throw new SemanticException("Internal error. ASTNode expected to have 0 or 1 child. " + ast.dump()); } }
ExprNodeDesc grpbyExprNDesc = astToExprNDescMap.get(grpbyExpr); if (grpbyExprNDesc == null) throw new CalciteSemanticException("Invalid Column Reference: " + grpbyExpr.dump(), UnsupportedFeature.Invalid_column_reference);
ExprNodeDesc grpbyExprNDesc = astToExprNDescMap.get(grpbyExpr); if (grpbyExprNDesc == null) throw new CalciteSemanticException("Invalid Column Reference: " + grpbyExpr.dump(), UnsupportedFeature.Invalid_column_reference);
this.ctx.setCboSucceeded(true); if (LOG.isTraceEnabled()) { LOG.trace(newAST.dump());