Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-824

Sqoop code generation in 'update' export mode incompatible with '--columns' option

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.2
    • 1.4.3
    • codegen, tools

    Description

      When using sqoop export with --update-key and --columns the options are incompatible. For example, given table T1

        +------+
        | T1   |
        +------+
        | id   |
        | name |
        | mail |
        | cell |
        +-------
      

      When using:

      $ sqoop export [ .. ] --update-key id --update-mode allowinsert --columns id,name
      

      the code generation utility creates a Java file which fails to compile.

      This seems to happen because ConnManager appends all table columns, even those not mentioned on the command-line (see ConnManager.configureDbOutputColumns). As a result, the generated class contains a write method which references class members which do not exist.

      I could suggest two possible solutions: 1) either make this case an exception or 2) make the code that appends all remaining table columns optional.

      I may be missing something as that code is there for a reason, but I can't see why?

      Attachments

        1. bugSQOOP-824.patch
          5 kB
          Jarek Jarcec Cecho

        Issue Links

          Activity

            People

              jarcec Jarek Jarcec Cecho
              stanangeloff Stan Angeloff
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: