public static ExprNodeDesc buildExprNode(ASTNode expr, TypeCheckCtx typeCheckCtx) throws SemanticException { // todo: use SemanticAnalyzer::genExprNodeDesc // currently SA not available to PTFTranslator. Map<ASTNode, ExprNodeDesc> map = TypeCheckProcFactory .genExprNode(expr, typeCheckCtx); ExprNodeDesc desc = map.get(expr); if (desc == null) { String errMsg = typeCheckCtx.getError(); if ( errMsg == null) { errMsg = "Error in parsing "; } throw new SemanticException(errMsg); } return desc; } }
public static ExprNodeDesc buildExprNode(ASTNode expr, TypeCheckCtx typeCheckCtx) throws SemanticException { // todo: use SemanticAnalyzer::genExprNodeDesc // currently SA not available to PTFTranslator. Map<ASTNode, ExprNodeDesc> map = TypeCheckProcFactory .genExprNode(expr, typeCheckCtx); ExprNodeDesc desc = map.get(expr); if (desc == null) { String errMsg = typeCheckCtx.getError(); if ( errMsg == null) { errMsg = "Error in parsing "; } throw new SemanticException(errMsg); } return desc; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { TypeCheckCtx ctx = (TypeCheckCtx) procCtx; if (ctx.getError() != null) { return null; } ExprNodeDesc desc = TypeCheckProcFactory.processGByExpr(nd, procCtx); if (desc != null) { return desc; } return new ExprNodeConstantDesc(TypeInfoFactory.getPrimitiveTypeInfoFromPrimitiveWritable(NullWritable.class), null); }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { TypeCheckCtx ctx = (TypeCheckCtx) procCtx; if (ctx.getError() != null) { return null; } ExprNodeDesc desc = TypeCheckProcFactory.processGByExpr(nd, procCtx); if (desc != null) { return desc; } return new ExprNodeConstantDesc(TypeInfoFactory.getPrimitiveTypeInfoFromPrimitiveWritable(NullWritable.class), null); }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { TypeCheckCtx ctx = (TypeCheckCtx) procCtx; if (ctx.getError() != null) { return null; } ExprNodeDesc desc = TypeCheckProcFactory.processGByExpr(nd, procCtx); if (desc != null) { return desc; } ASTNode expr = (ASTNode) nd; Boolean bool = null; switch (expr.getToken().getType()) { case HiveParser.KW_TRUE: bool = Boolean.TRUE; break; case HiveParser.KW_FALSE: bool = Boolean.FALSE; break; default: assert false; } return new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, bool); }
if (ctx.getError() != null) { return null;
ExprNodeDesc desc = nodeOutputs.get(expr); if (desc == null) { String errMsg = tcCtx.getError(); if (errMsg == null) { errMsg = "Error in parsing ";
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { TypeCheckCtx ctx = (TypeCheckCtx) procCtx; if (ctx.getError() != null) { return null; } ExprNodeDesc desc = TypeCheckProcFactory.processGByExpr(nd, procCtx); if (desc != null) { return desc; } ASTNode expr = (ASTNode) nd; Boolean bool = null; switch (expr.getToken().getType()) { case HiveParser.KW_TRUE: bool = Boolean.TRUE; break; case HiveParser.KW_FALSE: bool = Boolean.FALSE; break; default: assert false; } return new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, bool); }
errMsg = ErrorMsg.NON_KEY_EXPR_IN_GROUPBY.getMsg(expr); } else { errMsg = tcCtx.getError();
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;
if (ctx.getError() != null) { return null;