private ExprNodeConstantDesc getConstant(ExprDynamicParamDesc dynamicExpr, TypeInfo typeInfo,
      Map<Integer, ASTNode> parameterMap) throws SemanticException {
    Preconditions.checkArgument(parameterMap.containsKey(dynamicExpr.getIndex()),
        "Paramter index not found");

    ASTNode paramNode = parameterMap.get(dynamicExpr.getIndex());

    TypeCheckCtx typeCheckCtx = new TypeCheckCtx(null);
    ExprNodeDesc node = ExprNodeTypeCheck.genExprNode(paramNode, typeCheckCtx).get(paramNode);
    Preconditions.checkArgument(node instanceof ExprNodeConstantDesc,
        "Invalid expression created");
    return (ExprNodeConstantDesc)node;
  }
This method creates a constant expression to replace the given dynamic expression.
@param dynamicExpr Expression node representing Dynamic expression
@param typeInfo Type info used to create constant expression from ASTNode
@param parameterMap Integer to AST node map
ql/src/java/org/apache/hadoop/hive/ql/parse/ExecuteStatementAnalyzer.java