Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-699

sqoop start script looks for jars in wrong order

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: CDH 5.3.2
    • Fix Version/s: None
    • Component/s: Sqoop
    • Labels:
      None
    • Environment:
      Linux

      Description

      The sqoop start script allows the user to include custom jar's by placing them into the folder "/var/lib/sqoop". In addition to that location, the script also looks into the folder "/usr/share/java". Technically this is performed by the line

      SQOOP_JARS=`ls /var/lib/sqoop/.jar /usr/share/java/.jar 2>/dev/null`

      in the ssqoop start script. This seems to allow to store sqoop-specific versions of jar files in "/var/lib/sqoop" which would override versions of similar jars in "/usr/share/java". For example (this was our use case), this allows to store a more up-to-date version of the java-mysql-connector in /var/lib/sqoop while the system provided version still remains in /usr/share/java.

      Unfortunetaly this doesn't work as expected, because the "ls" command will sort its result by name. So all files in "/usr/share/java" are sorted in front of the files in "/var/lib/sqoop". An easy fix of the situation is to turn off the sorting by adding the option "-U" to ls:

      SQOOP_JARS=`ls -U /var/lib/sqoop/.jar /usr/share/java/.jar 2>/dev/null`

      I guess the behaviour with this modification reflects the original idea behind that line.

        Attachments

          Activity

            People

            • Assignee:
              mgrover Mark Grover
              Reporter:
              kupferk Kaya Kupferschmidt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: