Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-5046

Hcatalog's bin/hcat script doesn't respect HIVE_HOME

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: HCatalog
    • Labels:
      None

      Description

      https://github.com/apache/hive/blob/trunk/hcatalog/bin/hcat#L81

      The quoted snippet (see below) intends to set HIVE_HOME if it's not set (i.e. HIVE_HOME is currently null).

      if [ -n ${HIVE_HOME} ]; then
      

      However, -n checks if the variable is not null. So, the above code ends up setting HIVE_HOME to the default value if it is actually set already, overriding the set value. This condition needs to be negated.

      Moreover, -n checks requires the string being tested to be enclosed in quotes.

      Reference:
      http://tldp.org/LDP/abs/html/comparison-ops.html

        Attachments

        1. HIVE-5046.1.patch
          0.4 kB
          Mark Grover

          Activity

            People

            • Assignee:
              mgrover Mark Grover
              Reporter:
              mgrover Mark Grover
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: