public static Type defineType(String type) {
    if (type == null) {
      return Type.NULL;
    }
    else if (type.equalsIgnoreCase("INT") || type.equalsIgnoreCase("INTEGER") || type.equalsIgnoreCase("BIGINT") ||
             type.equalsIgnoreCase("SMALLINT") || type.equalsIgnoreCase("TINYINT") ||
             type.equalsIgnoreCase("BINARY_INTEGER") || type.equalsIgnoreCase("PLS_INTEGER") ||
             type.equalsIgnoreCase("SIMPLE_INTEGER") || type.equalsIgnoreCase("INT2") ||
             type.equalsIgnoreCase("INT4") || type.equalsIgnoreCase("INT8")) {
      return Type.BIGINT;
    }
    else if (type.equalsIgnoreCase("CHAR") || type.equalsIgnoreCase("VARCHAR") || type.equalsIgnoreCase("VARCHAR2") || 
             type.equalsIgnoreCase("STRING") || type.equalsIgnoreCase("XML") || type.equalsIgnoreCase("CHARACTER")) {
      return Type.STRING;
    }
    else if (type.equalsIgnoreCase("DEC") || type.equalsIgnoreCase("DECIMAL") || type.equalsIgnoreCase("NUMERIC") ||
             type.equalsIgnoreCase("NUMBER")) {
      return Type.DECIMAL;
    }
    else if (type.equalsIgnoreCase("REAL") || type.equalsIgnoreCase("FLOAT") || type.toUpperCase().startsWith("DOUBLE") ||
             type.equalsIgnoreCase("BINARY_FLOAT") || type.toUpperCase().startsWith("BINARY_DOUBLE") ||
             type.equalsIgnoreCase("SIMPLE_FLOAT") || type.toUpperCase().startsWith("SIMPLE_DOUBLE")) {
      return Type.DOUBLE;
    }
    else if (type.equalsIgnoreCase("DATE")) {
      return Type.DATE;
    }
    else if (type.equalsIgnoreCase("TIMESTAMP")) {
      return Type.TIMESTAMP;
    }
    else if (type.equalsIgnoreCase("BOOL") || type.equalsIgnoreCase("BOOLEAN")) {
      return Type.BOOL;
    }
    else if (type.equalsIgnoreCase("SYS_REFCURSOR")) {
      return Type.CURSOR;
    }
    else if (type.equalsIgnoreCase("UTL_FILE.FILE_TYPE")) {
      return Type.FILE;
    }
    else if (type.toUpperCase().startsWith("RESULT_SET_LOCATOR")) {
      return Type.RS_LOCATOR;
    }
    else if (type.equalsIgnoreCase(Var.DERIVED_TYPE)) {
      return Type.DERIVED_TYPE;
    }
    else if (type.equalsIgnoreCase(Type.HPL_OBJECT.name())) {
      return Type.HPL_OBJECT;
    }
    else if (type.equalsIgnoreCase(Type.ROW.name())) {
      return Type.ROW;
    }
    return Type.NULL;
  }
Define the data type from string representation
hplsql/src/main/java/org/apache/hive/hplsql/Var.java