Java Code Examples for org.apache.hadoop.util.StringUtils#COMMA_STR

The following examples show how to use org.apache.hadoop.util.StringUtils#COMMA_STR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnProjectionUtils.java    From tajo with Apache License 2.0 5 votes vote down vote up
/**
 * Sets read columns' ids(start from zero) for RCFile's Reader. Once a column
 * is included in the list, RCFile's reader will not skip its value.
 *
 */
public static void appendReadColumnIDs(Configuration conf,
                                       ArrayList<Integer> ids) {
  String id = toReadColumnIDString(ids);
  if (id != null) {
    String old = conf.get(READ_COLUMN_IDS_CONF_STR, null);
    String newConfStr = id;
    if (old != null) {
      newConfStr = newConfStr + StringUtils.COMMA_STR + old;
    }

    setReadColumnIDConf(conf, newConfStr);
  }
}
 
Example 2
Source File: ColumnProjectionUtils.java    From tajo with Apache License 2.0 5 votes vote down vote up
private static String toReadColumnIDString(ArrayList<Integer> ids) {
  String id = null;
  if (ids != null) {
    for (int i = 0; i < ids.size(); i++) {
      if (i == 0) {
        id = "" + ids.get(i);
      } else {
        id = id + StringUtils.COMMA_STR + ids.get(i);
      }
    }
  }
  return id;
}
 
Example 3
Source File: ColumnProjectionUtils.java    From incubator-tajo with Apache License 2.0 5 votes vote down vote up
/**
 * Sets read columns' ids(start from zero) for RCFile's Reader. Once a column
 * is included in the list, RCFile's reader will not skip its value.
 *
 */
public static void appendReadColumnIDs(Configuration conf,
                                       ArrayList<Integer> ids) {
  String id = toReadColumnIDString(ids);
  if (id != null) {
    String old = conf.get(READ_COLUMN_IDS_CONF_STR, null);
    String newConfStr = id;
    if (old != null) {
      newConfStr = newConfStr + StringUtils.COMMA_STR + old;
    }

    setReadColumnIDConf(conf, newConfStr);
  }
}
 
Example 4
Source File: ColumnProjectionUtils.java    From incubator-tajo with Apache License 2.0 5 votes vote down vote up
private static String toReadColumnIDString(ArrayList<Integer> ids) {
  String id = null;
  if (ids != null) {
    for (int i = 0; i < ids.size(); i++) {
      if (i == 0) {
        id = "" + ids.get(i);
      } else {
        id = id + StringUtils.COMMA_STR + ids.get(i);
      }
    }
  }
  return id;
}