Class HiveSyncTool


  • public class HiveSyncTool
    extends Object
    Utility class for syncing metadata from Hive to Snowflake
    Author:
    wwong
    • Constructor Detail

      • HiveSyncTool

        public HiveSyncTool​(org.apache.hadoop.hive.metastore.HiveMetaStoreClient hmsClient)
        Instantiates the HiveSyncTool.
        Parameters:
        hmsClient - a client for the Hive metastore
    • Method Detail

      • sync

        public void sync()
                  throws org.apache.thrift.TException
        Does a one-time, one-way metadata sync from the Hive metastore to Snowflake. 1. Tables in Hive are created in Snowflake 2. Partitions not in Hive are dropped from Snowflake 3. Partitions in Hive are added to Snowflake Note: does not drop tables from Snowflake.
        Throws:
        org.apache.thrift.TException - thrown when encountering a Thrift exception while communicating with the metastore or executing a metastore operation
      • main

        public static void main​(String[] args)
                         throws org.apache.thrift.TException
        A convenient entry point for the sync tool. Expects Hive and Hadoop libraries to be in the classpath. See also: sync()
        Parameters:
        args - program arguments, which are not used
        Throws:
        org.apache.thrift.TException - thrown when encountering a Thrift exception while communicating with the metastore or executing a metastore operation