Revision 41680
Added by Eri Katsari about 8 years ago
SqoopDriver.java | ||
---|---|---|
51 | 51 |
/** |
52 | 52 |
* Driver for the Sqoop tool. Calls the Sqoop Client for each <input file, |
53 | 53 |
* destination table> pair given in the @tables argument. |
54 |
*
|
|
54 |
* |
|
55 | 55 |
* Needed parameters ( connection, database name, etc are set in class |
56 | 56 |
* parameters when an new Sqoop Driver instance is created. |
57 |
*
|
|
57 |
* |
|
58 | 58 |
* @param tables |
59 | 59 |
*/ |
60 | 60 |
public void run(Multimap<String, String> tables) throws Exception { |
... | ... | |
65 | 65 |
|
66 | 66 |
String[] str = { "export", "-Dsqoop.export.records.per.statement =" + RecsPerStatement, "-Dsqoop.export.statements.per.transaction = " + StatementPerTrans, "-Dmapreduce.job.reduces = " + sqoopReducersCount, |
67 | 67 |
|
68 |
"--connect", connectionUrl, "--table", table.getKey(), |
|
68 |
"--connect", connectionUrl, "--table", table.getKey(),
|
|
69 | 69 |
|
70 |
"--export-dir", table.getValue(), |
|
70 |
"--export-dir", table.getValue(),
|
|
71 | 71 |
|
72 |
"--input-fields-terminated-by", delim,
|
|
72 |
"--input-fields-terminated-by", delim,
|
|
73 | 73 |
// "--input-enclosed-by", enclosed, |
74 |
"--optionally-enclosed-by", enclosed, |
|
74 |
"--optionally-enclosed-by", enclosed,
|
|
75 | 75 |
|
76 |
"--verbose", "--username", dbUser, "--password", dbPass, |
|
77 |
"--driver", "org.postgresql.Driver", "--batch", "--mapreduce-job-name", "Sqoop Stats Import Job for " + table.getKey(), "--m", sqoopReducersCount }; |
|
76 |
"--verbose", "--username", dbUser, "--password", dbPass, "--driver", "org.postgresql.Driver", "--batch", "--mapreduce-job-name", "Sqoop Stats Import Job for " + table.getKey(), "--m", sqoopReducersCount }; |
|
78 | 77 |
|
79 | 78 |
int ret = Sqoop.runTool(str); |
80 | 79 |
|
... | ... | |
223 | 222 |
|
224 | 223 |
/** |
225 | 224 |
* Cleans up auto-generated Sqoop class files |
226 |
*
|
|
225 |
* |
|
227 | 226 |
* @param table |
228 | 227 |
*/ |
229 | 228 |
|
Also available in: Unified diff
updates for multible output names and tables in job.properties