protected Map<String, String> getColNameToDefaultValueMap(Table tbl) throws SemanticException {
    Map<String, String> colNameToDefaultVal = null;
    try {
      DefaultConstraint dc = Hive.get().getEnabledDefaultConstraints(tbl.getDbName(), tbl.getTableName());
      colNameToDefaultVal = dc.getColNameToDefaultValueMap();
    } catch (Exception e) {
      if (e instanceof SemanticException) {
        throw (SemanticException) e;
      } else {
        throw (new RuntimeException(e));
      }
    }
    return colNameToDefaultVal;
  }
This method creates a list of default constraints which corresponds to
 given schema (targetSchema) or target table's column schema (if targetSchema is null)
@param tbl
@param targetSchema
@return List of default constraints (including NULL if there is no default)
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java