Class OracleDBRecordReader<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.OracleDBRecordReader<T>
- All Implemented Interfaces:
Closeable,AutoCloseable
A RecordReader that reads records from an Oracle SQL table.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration key to set to a timezone string.Fields inherited from class org.apache.hadoop.mapreduce.lib.db.DBRecordReader
statement -
Constructor Summary
ConstructorsConstructorDescriptionOracleDBRecordReader(org.apache.hadoop.mapreduce.lib.db.DBInputFormat.DBInputSplit split, Class<T> inputClass, Configuration conf, Connection conn, DBConfiguration dbConfig, String cond, String[] fields, String table) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the query for selecting the records from an Oracle DB.static voidsetSessionTimeZone(Configuration conf, Connection conn) Set session time zoneMethods 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
-
Field Details
-
SESSION_TIMEZONE_KEY
Configuration key to set to a timezone string.- See Also:
-
-
Constructor Details
-
OracleDBRecordReader
public OracleDBRecordReader(org.apache.hadoop.mapreduce.lib.db.DBInputFormat.DBInputSplit split, Class<T> inputClass, Configuration conf, Connection conn, DBConfiguration dbConfig, String cond, String[] fields, String table) throws SQLException - Throws:
SQLException
-
-
Method Details
-
getSelectQuery
Returns the query for selecting the records from an Oracle DB.- Overrides:
getSelectQueryin classDBRecordReader<T extends DBWritable>
-
setSessionTimeZone
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:
SQLException
-