@Override public ASTNode preAnalyze(HiveSemanticAnalyzerHookContext context, ASTNode ast) throws SemanticException { if (ast.getType() == HiveParser.TOK_EXPLAIN) { int childCount = ast.getChildCount(); for (int i = 1; i < childCount; i++) { if (ast.getChild(i).getType() == HiveParser.KW_REOPTIMIZATION) { explainReOptimization = true; ast.deleteChild(i); break; } } if (explainReOptimization && firstExecution()) { Tree execTree = ast.getChild(0); execTree.setParent(ast.getParent()); ast.getParent().setChild(0, execTree); return (ASTNode) execTree; } } return ast; }
public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@Override public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@Override public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@Override public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@Override public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@Override public void setParent(Object t, Object parent) { if ( t!=null ) ((Tree)t).setParent((Tree)parent); }
@SuppressWarnings("unchecked") public AbstFelNode(CommonTree node) { super(node); if (node.getChildren() != null) { this.children = new ArrayList<FelNode>(node.getChildren()); for (int i = 0; i < this.children.size(); i++) { Tree object = (Tree) this.children.get(i); object.setParent(this); } } }
public void setChild(int i, Tree t) { if ( t==null ) { return; } if ( t.isNil() ) { throw new IllegalArgumentException("Can't set single child to a list"); } if ( children==null ) { children = createChildrenList(); } children.set(i, t); t.setParent(this); t.setChildIndex(i); }
@Override public void setChild(int i, Tree t) { if ( t==null ) { return; } if ( t.isNil() ) { throw new IllegalArgumentException("Can't set single child to a list"); } if ( children==null ) { children = createChildrenList(); } children.set(i, t); t.setParent(this); t.setChildIndex(i); }
@Override public void setChild(int i, Tree t) { if ( t==null ) { return; } if ( t.isNil() ) { throw new IllegalArgumentException("Can't set single child to a list"); } if ( children==null ) { children = createChildrenList(); } children.set(i, t); t.setParent(this); t.setChildIndex(i); }
@Override public void setChild(int i, Tree t) { if ( t==null ) { return; } if ( t.isNil() ) { throw new IllegalArgumentException("Can't set single child to a list"); } if ( children==null ) { children = createChildrenList(); } children.set(i, t); t.setParent(this); t.setChildIndex(i); }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = (Tree)getChild(c); child.setChildIndex(c); child.setParent(this); } }
/** Transform ^(nil x) to x and nil to null */ @Override public Object rulePostProcessing(Object root) { //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree()); Tree r = (Tree)root; if ( r!=null && r.isNil() ) { if ( r.getChildCount()==0 ) { r = null; } else if ( r.getChildCount()==1 ) { r = r.getChild(0); // whoever invokes rule will set parent and child index r.setParent(null); r.setChildIndex(-1); } } return r; }
/** Transform ^(nil x) to x and nil to null */ public Object rulePostProcessing(Object root) { //System.out.println("rulePostProcessing: "+((Tree)root).toStringTree()); Tree r = (Tree)root; if ( r!=null && r.isNil() ) { if ( r.getChildCount()==0 ) { r = null; } else if ( r.getChildCount()==1 ) { r = (Tree)r.getChild(0); // whoever invokes rule will set parent and child index r.setParent(null); r.setChildIndex(-1); } } return r; }