sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevin00chen <...@git.apache.org>
Subject [GitHub] sqoop pull request #26: [SQOOP-3002] sqoop merge tool composite merge-key
Date Mon, 22 Aug 2016 15:24:54 GMT
Github user kevin00chen commented on a diff in the pull request:

    https://github.com/apache/sqoop/pull/26#discussion_r75698508
  
    --- Diff: src/java/org/apache/sqoop/mapreduce/MergeMapperBase.java ---
    @@ -76,9 +76,10 @@ protected void processRecord(SqoopRecord r, Context c)
         }
         Object keyObj = null;
         if (keyColName.contains(",")) {
    +        String connectStr = new String(new byte[]{1});
             StringBuilder keyFieldsSb = new StringBuilder();
             for (String str : keyColName.split(",")) {
    -            keyFieldsSb.append("+").append(fieldMap.get(str).toString());
    +            keyFieldsSb.append(connectStr).append(fieldMap.get(str).toString());
    --- End diff --
    
    for example one table has two column, a and b
    
    Field a | Field b
    ------------ | -------------
    a+ | b
    a | +b
    
    when use "+" to connect two field, two record will has same keyObj.
    To avoid this i use a String contains one byte.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message