public static String arrayToString(String[] strs) {
    if (strs.length == 0) { return ""; }
    StringBuilder sbuf = new StringBuilder();
    sbuf.append(strs[0]);
    for (int idx = 1; idx < strs.length; idx++) {
      sbuf.append(",");
      sbuf.append(strs[idx]);
    }
    return sbuf.toString();
  }
Given an array of strings, return a comma-separated list of its elements.
@param strs Array of strings
@return Empty string if strs.length is 0, comma separated list of strings
otherwise
common/src/java/org/apache/hive/common/util/HiveStringUtils.java