protected T createConstantExpr(String value) throws SemanticException {
    // The expression can be any one of Double, Long and Integer. We
    // try to parse the expression in that order to ensure that the
    // most specific type is used for conversion.
    T result = null;
    T result2 = null;
    try {
      result = createDoubleConstantExpr(value);
      if (value != null && !value.toLowerCase().contains("e")) {
        result2 = createDecimalConstantExpr(value, false);
        if (result2 != null) {
          result = null; // We will use decimal if all else fails.
        }
      }
      result = createBigintConstantExpr(value);
      result = createIntConstantExpr(value);
    } catch (NumberFormatException e) {
      // do nothing here, we will throw an exception in the following block
    }
    return result != null ? result : result2;
  }
Default generator for constant expression when type cannot be inferred
from input query.
ql/src/java/org/apache/hadoop/hive/ql/parse/type/ExprFactory.java