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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.11.0
    • 0.12.0
    • HCatalog
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: