org.apache.hadoop.mapreduce.lib.db
Class OracleDBRecordReader<T extends DBWritable>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,T>
org.apache.hadoop.mapreduce.lib.db.DBRecordReader<T>
org.apache.hadoop.mapreduce.lib.db.OracleDBRecordReader<T>
- All Implemented Interfaces:
- java.io.Closeable
public class OracleDBRecordReader<T extends DBWritable>
- extends DBRecordReader<T>
A RecordReader that reads records from an Oracle SQL table.
Field Summary |
static java.lang.String |
SESSION_TIMEZONE_KEY
Configuration key to set to a timezone string. |
Method Summary |
protected java.lang.String |
getSelectQuery()
Returns the query for selecting the records from an Oracle DB. |
static void |
setSessionTimeZone(org.apache.hadoop.conf.Configuration conf,
java.sql.Connection conn)
Set session time zone |
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 |
SESSION_TIMEZONE_KEY
public static final java.lang.String SESSION_TIMEZONE_KEY
- Configuration key to set to a timezone string.
- See Also:
- Constant Field Values
OracleDBRecordReader
public OracleDBRecordReader(DBInputFormat.DBInputSplit split,
java.lang.Class<T> inputClass,
org.apache.hadoop.conf.Configuration conf,
java.sql.Connection conn,
DBConfiguration dbConfig,
java.lang.String cond,
java.lang.String[] fields,
java.lang.String table)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getSelectQuery
protected java.lang.String getSelectQuery()
- Returns the query for selecting the records from an Oracle DB.
- Overrides:
getSelectQuery
in class DBRecordReader<T extends DBWritable>
setSessionTimeZone
public static void setSessionTimeZone(org.apache.hadoop.conf.Configuration conf,
java.sql.Connection conn)
throws java.sql.SQLException
- Set session time zone
- Parameters:
conf
- The current configuration.
We read the 'oracle.sessionTimeZone' property from here.conn
- The connection to alter the timezone properties of.
- Throws:
java.sql.SQLException
Copyright © 2009 The Apache Software Foundation