Example usage for org.apache.hadoop.mapred.lib.db DBConfiguration INPUT_FIELD_NAMES_PROPERTY

List of usage examples for org.apache.hadoop.mapred.lib.db DBConfiguration INPUT_FIELD_NAMES_PROPERTY

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred.lib.db DBConfiguration INPUT_FIELD_NAMES_PROPERTY.

Prototype

String INPUT_FIELD_NAMES_PROPERTY

To view the source code for org.apache.hadoop.mapred.lib.db DBConfiguration INPUT_FIELD_NAMES_PROPERTY.

Click Source Link

Document

Field names in the Input table

Usage

From source file:com.vertica.hivestoragehandler.VerticaStorageHandler.java

License:Apache License

private void configureJobProperties(TableDesc tableDesc, Map<String, String> jobProperties) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("tableDesc: " + tableDesc);
        LOG.debug("jobProperties: " + jobProperties);
    }//  ww  w .  jav  a  2 s.  c  o m

    String tblName = tableDesc.getTableName();
    Properties tblProps = tableDesc.getProperties();
    String columnNames = tblProps.getProperty(Constants.LIST_COLUMNS);
    jobProperties.put(DBConfiguration.INPUT_CLASS_PROPERTY, DbRecordWritable.class.getName());
    jobProperties.put(DBConfiguration.INPUT_TABLE_NAME_PROPERTY, tblName);
    jobProperties.put(DBConfiguration.OUTPUT_TABLE_NAME_PROPERTY, tblName);
    jobProperties.put(DBConfiguration.INPUT_FIELD_NAMES_PROPERTY, columnNames);
    jobProperties.put(DBConfiguration.OUTPUT_FIELD_NAMES_PROPERTY, columnNames);

    for (String key : tblProps.stringPropertyNames()) {
        if (key.startsWith("mapred.jdbc.")) {
            String value = tblProps.getProperty(key);
            LOG.info("JSH key = " + key + ", value = " + value);
            jobProperties.put(key, value);
            String key2 = key.replace("mapred.", "mapreduce.");
            if (!key.equalsIgnoreCase(key2)) {
                LOG.info("JSH key = " + key2 + ", value = " + value);
                jobProperties.put(key2, value);
            }
        }
    }
}

From source file:infinidb.hadoop.db.InfiniDBConfiguration.java

License:Apache License

String[] getInputFieldNames() {
    return job.getStrings(DBConfiguration.INPUT_FIELD_NAMES_PROPERTY);
}

From source file:infinidb.hadoop.db.InfiniDBConfiguration.java

License:Apache License

void setInputFieldNames(String... fieldNames) {
    job.setStrings(DBConfiguration.INPUT_FIELD_NAMES_PROPERTY, fieldNames);
}