hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amandeep Khurana <ama...@gmail.com>
Subject How to use DBInputFormat?
Date Wed, 04 Feb 2009 01:49:46 GMT
In the setInput(...) function in DBInputFormat, there are two sets of
arguments that one can use.

1. public static void *setInput*(JobConf
<http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/JobConf.html>
job,
                            Class
<http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true><?
extends DBWritable
<http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/lib/db/DBWritable.html>>
inputClass,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>
tableName,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>
conditions,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>
orderBy,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>...
fieldNames)

a) In this, do we necessarily have to give all the fieldNames (which are the
column names right?) that the table has, or do we need to specify only the
ones that we want to extract?
b) Do we have to have a orderBy or not necessarily? Does this relate to the
primary key in the table in any ways?

2. public static void *setInput*(JobConf
<http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/JobConf.html>
job,
                            Class
<http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true><?
extends DBWritable
<http://hadoop.apache.org/core/docs/current/api/org/apache/hadoop/mapred/lib/db/DBWritable.html>>
inputClass,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>
inputQuery,
                            String
<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>
inputCountQuery)

a) Is there any restriction on the kind of queries that this function
can take in the inputQuery string?

I am facing issues in getting this to work with an Oracle database and
have no idea of how to debug it (an email sent earlier).
Can anyone give me some inputs on this please?

Thanks
-Amandeep


Amandeep Khurana
Computer Science Graduate Student
University of California, Santa Cruz

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message