/** * Set properties for the input format. * @param properties properties for the input specification * @return this * @throws IOException on all errors */ public HCatInputFormat setProperties(Properties properties) throws IOException { Preconditions.checkNotNull(properties, "required argument 'properties' is null"); inputJobInfo = InputJobInfo.create( inputJobInfo.getDatabaseName(), inputJobInfo.getTableName(), inputJobInfo.getFilter(), properties); try { InitializeInput.setInput(conf, inputJobInfo); } catch (Exception e) { throw new IOException(e); } return this; }
@Test public void test4ArgCreate() throws Exception { Properties p = new Properties(); p.setProperty("key", "value"); InputJobInfo jobInfo = InputJobInfo.create("Db", "Table", "Filter", p); Assert.assertEquals("Db", jobInfo.getDatabaseName()); Assert.assertEquals("Table", jobInfo.getTableName()); Assert.assertEquals("Filter", jobInfo.getFilter()); Assert.assertEquals("value", jobInfo.getProperties().getProperty("key")); }
/** * Set the input to use for the Job. This queries the metadata server with the specified * partition predicates, gets the matching partitions, and puts the information in the job * configuration object. * * To ensure a known InputJobInfo state, only the database name, table name, filter, and * properties are preserved. All other modification from the given InputJobInfo are discarded. * * After calling setInput, InputJobInfo can be retrieved from the job configuration as follows: * {code} * LinkedList<InputJobInfo> inputInfo = (LinkedList<InputJobInfo>) HCatUtil * .deserialize(job.getConfiguration().get(HCatConstants.HCAT_KEY_JOB_INFO)); * {code} * * @param conf the job Configuration object * @param theirInputJobInfo information on the Input to read * @throws Exception */ public static void setInput(Configuration conf, InputJobInfo theirInputJobInfo) throws Exception { InputJobInfo inputJobInfo = InputJobInfo.create( theirInputJobInfo.getDatabaseName(), theirInputJobInfo.getTableName(), theirInputJobInfo.getFilter(), theirInputJobInfo.getProperties()); populateInputJobInfo(conf, inputJobInfo, null); HCatUtil.putInputJobInfoToConf(inputJobInfo, conf); }
inputJobInfo.getFilter(), (short) -1);
/** * Set properties for the input format. * @param properties properties for the input specification * @return this * @throws IOException on all errors */ public HCatInputFormat setProperties(Properties properties) throws IOException { Preconditions.checkNotNull(properties, "required argument 'properties' is null"); inputJobInfo = InputJobInfo.create( inputJobInfo.getDatabaseName(), inputJobInfo.getTableName(), inputJobInfo.getFilter(), properties); try { InitializeInput.setInput(conf, inputJobInfo); } catch (Exception e) { throw new IOException(e); } return this; }
/** * Set properties for the input format. * @param properties properties for the input specification * @return this * @throws IOException on all errors */ public HCatInputFormat setProperties(Properties properties) throws IOException { Preconditions.checkNotNull(properties, "required argument 'properties' is null"); inputJobInfo = InputJobInfo.create( inputJobInfo.getDatabaseName(), inputJobInfo.getTableName(), inputJobInfo.getFilter(), properties); try { InitializeInput.setInput(conf, inputJobInfo); } catch (Exception e) { throw new IOException(e); } return this; }
/** * Set properties for the input format. * @param properties properties for the input specification * @return this * @throws IOException on all errors */ public HCatInputFormat setProperties(Properties properties) throws IOException { Preconditions.checkNotNull(properties, "required argument 'properties' is null"); inputJobInfo = InputJobInfo.create( inputJobInfo.getDatabaseName(), inputJobInfo.getTableName(), inputJobInfo.getFilter(), properties); try { InitializeInput.setInput(conf, inputJobInfo); } catch (Exception e) { throw new IOException(e); } return this; }
/** * Set properties for the input format. * @param properties properties for the input specification * @return this * @throws IOException on all errors */ public HCatInputFormat setProperties(Properties properties) throws IOException { Preconditions.checkNotNull(properties, "required argument 'properties' is null"); inputJobInfo = InputJobInfo.create( inputJobInfo.getDatabaseName(), inputJobInfo.getTableName(), inputJobInfo.getFilter(), properties); try { InitializeInput.setInput(conf, inputJobInfo); } catch (Exception e) { throw new IOException(e); } return this; }
/** * Set the input to use for the Job. This queries the metadata server with the specified * partition predicates, gets the matching partitions, and puts the information in the job * configuration object. * * To ensure a known InputJobInfo state, only the database name, table name, filter, and * properties are preserved. All other modification from the given InputJobInfo are discarded. * * After calling setInput, InputJobInfo can be retrieved from the job configuration as follows: * {code} * InputJobInfo inputInfo = (InputJobInfo) HCatUtil.deserialize( * job.getConfiguration().get(HCatConstants.HCAT_KEY_JOB_INFO)); * {code} * * @param conf the job Configuration object * @param theirInputJobInfo information on the Input to read * @throws Exception */ public static void setInput(Configuration conf, InputJobInfo theirInputJobInfo) throws Exception { InputJobInfo inputJobInfo = InputJobInfo.create( theirInputJobInfo.getDatabaseName(), theirInputJobInfo.getTableName(), theirInputJobInfo.getFilter(), theirInputJobInfo.getProperties()); conf.set( HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(getInputJobInfo(conf, inputJobInfo, null))); }
/** * Set the input to use for the Job. This queries the metadata server with the specified * partition predicates, gets the matching partitions, and puts the information in the job * configuration object. * * To ensure a known InputJobInfo state, only the database name, table name, filter, and * properties are preserved. All other modification from the given InputJobInfo are discarded. * * After calling setInput, InputJobInfo can be retrieved from the job configuration as follows: * {code} * InputJobInfo inputInfo = (InputJobInfo) HCatUtil.deserialize( * job.getConfiguration().get(HCatConstants.HCAT_KEY_JOB_INFO)); * {code} * * @param conf the job Configuration object * @param theirInputJobInfo information on the Input to read * @throws Exception */ public static void setInput(Configuration conf, InputJobInfo theirInputJobInfo) throws Exception { InputJobInfo inputJobInfo = InputJobInfo.create( theirInputJobInfo.getDatabaseName(), theirInputJobInfo.getTableName(), theirInputJobInfo.getFilter(), theirInputJobInfo.getProperties()); conf.set( HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(getInputJobInfo(conf, inputJobInfo, null))); }
/** * Set the input to use for the Job. This queries the metadata server with the specified * partition predicates, gets the matching partitions, and puts the information in the job * configuration object. * * To ensure a known InputJobInfo state, only the database name, table name, filter, and * properties are preserved. All other modification from the given InputJobInfo are discarded. * * After calling setInput, InputJobInfo can be retrieved from the job configuration as follows: * {code} * InputJobInfo inputInfo = (InputJobInfo) HCatUtil.deserialize( * job.getConfiguration().get(HCatConstants.HCAT_KEY_JOB_INFO)); * {code} * * @param conf the job Configuration object * @param theirInputJobInfo information on the Input to read * @throws Exception */ public static void setInput(Configuration conf, InputJobInfo theirInputJobInfo) throws Exception { InputJobInfo inputJobInfo = InputJobInfo.create( theirInputJobInfo.getDatabaseName(), theirInputJobInfo.getTableName(), theirInputJobInfo.getFilter(), theirInputJobInfo.getProperties()); conf.set( HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(getInputJobInfo(conf, inputJobInfo, null))); }
/** * Set the input to use for the Job. This queries the metadata server with the specified * partition predicates, gets the matching partitions, and puts the information in the job * configuration object. * * To ensure a known InputJobInfo state, only the database name, table name, filter, and * properties are preserved. All other modification from the given InputJobInfo are discarded. * * After calling setInput, InputJobInfo can be retrieved from the job configuration as follows: * {code} * InputJobInfo inputInfo = (InputJobInfo) HCatUtil.deserialize( * job.getConfiguration().get(HCatConstants.HCAT_KEY_JOB_INFO)); * {code} * * @param conf the job Configuration object * @param theirInputJobInfo information on the Input to read * @throws Exception */ public static void setInput(Configuration conf, InputJobInfo theirInputJobInfo) throws Exception { InputJobInfo inputJobInfo = InputJobInfo.create( theirInputJobInfo.getDatabaseName(), theirInputJobInfo.getTableName(), theirInputJobInfo.getFilter(), theirInputJobInfo.getProperties()); conf.set( HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(getInputJobInfo(conf, inputJobInfo, null))); }
inputJobInfo.getFilter(), (short) -1);
inputJobInfo.getFilter(), (short) -1);
inputJobInfo.getFilter(), (short) -1);
inputJobInfo.getFilter(), (short) -1);