protected List<String> getDefaultConstraints(Table tbl, List<String> targetSchema) throws SemanticException{
    Map<String, String> colNameToDefaultVal = getColNameToDefaultValueMap(tbl);
    List<String> defaultConstraints = new ArrayList<>();
    if(targetSchema != null && !targetSchema.isEmpty()) {
      for (String colName : targetSchema) {
        defaultConstraints.add(colNameToDefaultVal.get(colName));
      }
    }
    else {
      for(FieldSchema fs:tbl.getCols()) {
        defaultConstraints.add(colNameToDefaultVal.get(fs.getName()));
      }
    }
    return defaultConstraints;
  }
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