DataDrivenDBRecordReader (Hadoop 0.20.2-cdh3u4 API)
Date: 2012-05-07

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.mapreduce.lib.db
Class DataDrivenDBRecordReader<T extends DBWritable>

    java.lang.Object
      org.apache.hadoop.mapreduce.RecordReader<LongWritable,T>
          org.apache.hadoop.mapreduce.lib.db.DBRecordReader<T>
              org.apache.hadoop.mapreduce.lib.db.DataDrivenDBRecordReader<T>

All Implemented Interfaces:
  Closeable

Direct Known Subclasses:
  MySQLDataDrivenDBRecordReader, OracleDataDrivenDBRecordReader

    public class DataDrivenDBRecordReader<T extends DBWritable>

extends DBRecordReader<T>

A RecordReader that reads records from a SQL table, using data-driven WHERE clause splits. Emits LongWritables containing the record number as key and DBWritables as value.

Constructor Summary
`DataDrivenDBRecordReader(DBInputFormat.DBInputSplit split, Class<T> inputClass, Configuration conf, Connection conn, DBConfiguration dbConfig, String cond, String[] fields, String table, String dbProduct)`

Method Summary
`protected String` | `getSelectQuery()` Returns the query for selecting the records, subclasses can override this for custom behaviour.

Methods inherited from class org.apache.hadoop.mapreduce.lib.db.DBRecordReader
`close, createValue, executeQuery, getConditions, getConnection, getCurrentKey, getCurrentValue, getDBConf, getFieldNames, getPos, getProgress, getSplit, getStatement, getTableName, initialize, next, nextKeyValue, setStatement`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataDrivenDBRecordReader

    public DataDrivenDBRecordReader(DBInputFormat.DBInputSplit split,
                                    Class<T> inputClass,
                                    Configuration conf,
                                    Connection conn,
                                    DBConfiguration dbConfig,
                                    String cond,
                                    String[] fields,
                                    String table,
                                    String dbProduct)
                             throws SQLException

Parameters:
  `split` - The InputSplit to read data for
Throws:
  `SQLException`

Method Detail

### getSelectQuery

    protected String getSelectQuery()

  Returns the query for selecting the records, subclasses can override this for custom behaviour.

  Overrides:
    `getSelectQuery` in class `DBRecordReader<T extends DBWritable>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation