Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-3233

SqoopHCatImportHelper.convertNumberTypes check for Varchar instead of Char

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.6
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      I found an issue in SqoopHCatImportHelper.convertNumberTypes method. In the if block it checks for VARCHAR type and in the if else statement it does the same but should be a CHAR check.

      org.apache.sqoop.mapreduce.hcat.SqoopHCatImportHelper.convertNumberTypes
      if (hfsType == HCatFieldSchema.Type.VARCHAR) {
              VarcharTypeInfo vti = (VarcharTypeInfo) hfs.getTypeInfo();
              HiveVarchar hvc = new HiveVarchar(bdStr, vti.getLength());
              return hvc;
            } else if (hfsType == HCatFieldSchema.Type.VARCHAR) {
              CharTypeInfo cti = (CharTypeInfo) hfs.getTypeInfo();
              HiveChar hChar = new HiveChar(bdStr, cti.getLength());
              return hChar;
            } else {
              return bdStr;
            }
      

        Attachments

        1. SQOOP-3233.patch
          6 kB
          Fero Szabo

          Issue Links

            Activity

              People

              • Assignee:
                fero Fero Szabo
                Reporter:
                Swank Zoltán Tóth
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: