5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 04:42:22 +08:00
This commit is contained in:
bobokele 2021-03-17 22:31:35 +08:00 committed by GitHub
commit bf38792002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,18 @@ protected void processRecord(SqoopRecord r, Context c)
if (null == fieldMap) {
throw new IOException("No field map in record " + r);
}
Object keyObj = fieldMap.get(keyColName);
Object keyObj = null;
if (keyColName.contains(",")) {
String connectStr = new String(new byte[]{1});
StringBuilder keyFieldsSb = new StringBuilder();
for (String str : keyColName.split(",")) {
keyFieldsSb.append(connectStr).append(fieldMap.get(str).toString());
}
keyObj = keyFieldsSb;
} else {
keyObj = fieldMap.get(keyColName);
}
if (null == keyObj) {
throw new IOException("Cannot join values on null key. "
+ "Did you specify a key column that exists?");