mirror of
https://github.com/apache/sqoop.git
synced 2025-05-04 05:20:22 +08:00
sqoop merge tool composite merge-key
This commit is contained in:
parent
b9794f98e3
commit
cd1e840c8d
@ -74,7 +74,17 @@ protected void processRecord(SqoopRecord r, Context c)
|
|||||||
if (null == fieldMap) {
|
if (null == fieldMap) {
|
||||||
throw new IOException("No field map in record " + r);
|
throw new IOException("No field map in record " + r);
|
||||||
}
|
}
|
||||||
Object keyObj = fieldMap.get(keyColName);
|
Object keyObj = null;
|
||||||
|
if (keyColName.contains(",")) {
|
||||||
|
StringBuilder keyFieldsSb = new StringBuilder();
|
||||||
|
for (String str : keyColName.split(",")) {
|
||||||
|
keyFieldsSb.append("+").append(fieldMap.get(str).toString());
|
||||||
|
}
|
||||||
|
keyObj = keyFieldsSb;
|
||||||
|
} else {
|
||||||
|
keyObj = fieldMap.get(keyColName);
|
||||||
|
}
|
||||||
|
|
||||||
if (null == keyObj) {
|
if (null == keyObj) {
|
||||||
throw new IOException("Cannot join values on null key. "
|
throw new IOException("Cannot join values on null key. "
|
||||||
+ "Did you specify a key column that exists?");
|
+ "Did you specify a key column that exists?");
|
||||||
|
Loading…
Reference in New Issue
Block a user