/** * Appends read columns' ids (start from zero). Once a column * is included in the list, a underlying record reader of a columnar file format * (e.g. RCFile and ORC) can know what columns are needed. */ public static void appendReadColumns(Configuration conf, List<Integer> ids) { String id = toReadColumnIDString(ids); String old = conf.get(READ_COLUMN_IDS_CONF_STR, null); String newConfStr = HiveStringUtils.joinIgnoringEmpty(new String[] {id, old}, StringUtils.COMMA); setReadColumnIDConf(conf, newConfStr); // Set READ_ALL_COLUMNS to false conf.setBoolean(READ_ALL_COLUMNS, false); }
/** * Retrieve the resources from the current session and configuration for the given type. * @return Comma-separated list of resources */ protected static String getResource(HiveConf conf, SessionState.ResourceType resType) { switch(resType) { case JAR: String addedJars = Utilities.getResourceFiles(conf, SessionState.ResourceType.JAR); String auxJars = conf.getAuxJars(); String reloadableAuxJars = SessionState.get() == null ? null : SessionState.get().getReloadableAuxJars(); return HiveStringUtils.joinIgnoringEmpty(new String[]{addedJars, auxJars, reloadableAuxJars}, ','); case FILE: return Utilities.getResourceFiles(conf, SessionState.ResourceType.FILE); case ARCHIVE: return Utilities.getResourceFiles(conf, SessionState.ResourceType.ARCHIVE); } return null; }
/** * Retrieve the resources from the current session and configuration for the given type. * @return Comma-separated list of resources */ protected static String getResource(HiveConf conf, SessionState.ResourceType resType) { switch(resType) { case JAR: String addedJars = Utilities.getResourceFiles(conf, SessionState.ResourceType.JAR); String auxJars = conf.getAuxJars(); String reloadableAuxJars = SessionState.get() == null ? null : SessionState.get().getReloadableAuxJars(); return HiveStringUtils.joinIgnoringEmpty(new String[]{addedJars, auxJars, reloadableAuxJars}, ','); case FILE: return Utilities.getResourceFiles(conf, SessionState.ResourceType.FILE); case ARCHIVE: return Utilities.getResourceFiles(conf, SessionState.ResourceType.ARCHIVE); } return null; }
/** * Appends read columns' ids (start from zero). Once a column * is included in the list, a underlying record reader of a columnar file format * (e.g. RCFile and ORC) can know what columns are needed. */ public static void appendReadColumns(Configuration conf, List<Integer> ids) { String id = toReadColumnIDString(ids); String old = conf.get(READ_COLUMN_IDS_CONF_STR, null); String newConfStr = HiveStringUtils.joinIgnoringEmpty(new String[] {id, old}, StringUtils.COMMA); setReadColumnIDConf(conf, newConfStr); // Set READ_ALL_COLUMNS to false conf.setBoolean(READ_ALL_COLUMNS, false); }