Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Don't make any changes to hive_metastore.thrift until instructed below.
  2. Use the approved version of Thrift. This is currently thrift-0.14.1, which you can obtain from http://thrift.apache.org/.
    1. For Mac via Homebrew (since the version we need is not available by default):

      Code Block
      languagebash
      brew tap-new $USER/local-tap
      brew extract --version='0.14.1' thrift $USER/local-tap
      brew install thrift@0.14.1
      mkdir -p /usr/local/share/fb303/if
      cp /usr/local/Cellar/thrift@0.14.1/0.14.1/share/fb303/if/fb303.thrift /usr/local/share/fb303/if


    2. For Mac, building from sources:

      Code Block
      languagebash
      wget http://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz
      
      tar xzf thrift-0.14.1.tar.gz
      
      #If configure fails with "syntax error near unexpected token `QT5", then run "brew install pkg-config"
      
      ./bootstrap.sh
      
      sudo ./configure --with-openssl=/usr/local/Cellar/openssl@1.1/1.1.1j --without-erlang --without-nodejs --without-python --without-py3 --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go --without-swift --without-dotnetcore --without-qt5
      
      brew install openssl
      
      sudo ln -s /usr/local/opt/openssl/include/openssl/ /usr/local/include/
      
      sudo make
      
      sudo make install
      
      mkdir -p /usr/local/share/fb303/if
      
      cp path/to/thrift-0.14.1/contrib/fb303/if/fb303.thrift /usr/local/share/fb303/if/fb303.thrift
      # or alternatively the following command
      curl -o /usr/local/share/fb303/if/fb303.thrift https://raw.githubusercontent.com/apache/thrift/master/contrib/fb303/if/fb303.thrift


    3. For Linux:

      Code Block
      languagebash
      cd /path/to/thrift-0.14.1
      /configure -without-erlang --without-nodejs --without-python --without-py3 --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go --without-swift --without-dotnetcore --without-qt5
      sudo make
      sudo make install 
      sudo mkdir -p /usr/local/share/fb303/if
      sudo cp /path/to/thrift-0.14.1/contrib/fb303/if/fb303.thrift /usr/local/share/fb303/if/fb303.thrift


  3. Before proceeding, verify that which thrift returns the build of Thrift you just installed (typically /usr/local/bin on Linux); if not, edit your PATH and repeat the verification. Also verify that the command 'thrift -version' returns the expected version number of Thrift.

  4. Now you can run the Maven 'thriftif' profile to generate the Thrift code:
    1. cd /path/to/hive/
    2. mvn clean install -Pthriftif -DskipTests -Dthrift.home=/usr/local
  5. Verify that the code generation was a no-op, which should be the case if you have the correct Thrift version and everyone has been following these instructions. You may use git status for the same. If you can't figure out what is going wrong, ask for help from a committer.
  6. Now make your changes to hive_metastore.thrift, and then run the compiler again, from /path/to/hive/<hive_metastore.thrift's module>:
    1. mvn clean install -Pthriftif -DskipTests -Dthrift.home=/usr/local
  7. Now use git status and git diff to verify that the regenerated code corresponds only to the changes you made to hive_metastore.thrift. You may also need git add if new files were generated (and or git rm if some files are now obsoleted).
  8. cd /path/to/hive
  9. mvn clean package -DskiptTests (at the time of writing also "-Dmaven.javadoc.skip" is needed)
  10. Verify that Hive is still working correctly with both embedded and remote metastore configurations.

...