Oracle® In-Database Container for Hadoop Java API Reference
Release 1.0.1

E54638-01

oracle.sql.hadoop
Class DBMultipleInputs

java.lang.Object
  extended by oracle.sql.hadoop.DBMultipleInputs

public class DBMultipleInputs
extends java.lang.Object

This class supports MapReduce jobs that have multiple input tables with a different Mapper for each table


Constructor Summary
DBMultipleInputs()
           
 
Method Summary
static void addInputTable(Job job, java.lang.String table, java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass)
          Add a table with a custom Mapper to the list of inputs for the map-reduce job.
static void addInputTable(Job job, java.lang.String table, java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass, java.lang.Class<?> keyClass, java.lang.Class<?> valueClass)
          Add a table with a custom Mapper to the list of inputs for the map-reduce job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBMultipleInputs

public DBMultipleInputs()
Method Detail

addInputTable

public static void addInputTable(Job job,
                                 java.lang.String table,
                                 java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass)
                          throws java.io.IOException
Add a table with a custom Mapper to the list of inputs for the map-reduce job.

Example:

 Job job = new Job(Configuration conf);
 ...
 job.setOutputTableName("OutTable");
 DBMultipleInputs.addInputTable(job, "InTableA", MapperA.class);
 DBMultipleInputs.addInputTable(job, "InTableB", MapperB.class);
 job.init();
 job.run();
 Job will run as:
 (InTableA->MapperA UNION ALL InTableB->MapperB)->ReducerOfJob->OutTable
 

Parameters:
job - The Job
table - String to be added to the list of inputs for the job
mapperClass - Mapper class to use for this table
Throws:
java.io.IOException

addInputTable

public static void addInputTable(Job job,
                                 java.lang.String table,
                                 java.lang.Class<? extends org.apache.hadoop.mapreduce.Mapper> mapperClass,
                                 java.lang.Class<?> keyClass,
                                 java.lang.Class<?> valueClass)
                          throws java.io.IOException
Add a table with a custom Mapper to the list of inputs for the map-reduce job.

Example:

 Job job = new Job(Configuration conf);
 ...
 job.setOutputTableName("OutTable");
 DBMultipleInputs.addInputTable(job, "InTableA", MapperA.class,
 IntWritable.class, Text.class);
 DBMultipleInputs.addInputTable(job, "InTableB", MapperB.class,
 IntWritable.class, DoubleWritable.class);
 job.init();
 job.run();
 Job will run as:
 (InTableA->MapperA UNION ALL InTableB->MapperB)->ReducerOfJob->OutTable
 

Parameters:
job - The Job
table - String to be added to the list of inputs for the job
mapperClass - Mapper class to use for this table
keyClass - the input key class for mapper
valueClass - the input value class for mapper
Throws:
java.io.IOException

Oracle® In-Database Container for Hadoop Java API Reference
Release 1.0.1

E54638-01

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.