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

IMetaStoreClient getPartition method arguments incorrectly named

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Hive, Metastore
    • Patch

    Description

      The interface org.apache.hadoop.hive.metastore.IMetaStoreClient declares a method getPartition as:

      Partition getPartition(String tblName, String dbName, List<String> partVals) throws NoSuchObjectException, MetaException, TException;
      

      This is implemented in org.apache.hadoop.hive.metastore.HiveMetaStoreClient as:

      public Partition getPartition(String db_name, String tbl_name, List<String> part_vals) throws NoSuchObjectException, MetaException, TException {
        return deepCopy(filterHook.filterPartition(client.get_partition(db_name, tbl_name, part_vals)));
      }
      

      Note that in the above code the param named db_name occupies the tbl_name equivalent in the IMetaStoreClient method and vice-versa.

      The method called in HiveMetaStoreClient also seemingly expects db_name to appear first (see ThriftHiveMetastore.Iface.get_partition):

      public Partition get_partition(String db_name, String tbl_name, List<String> part_vals) throws MetaException, NoSuchObjectException, org.apache.thrift.TException;
      

      And following this all the way through to the implementation of org.apache.hadoop.hive.metastore.ObjectStore.getMTable(String, String) shows that the database name is ultimately taken from the first argument.

      Therefore I propose that the order needs to be corrected on IMetaStoreClient.

      Attachments

        1. HIVE-11230.1.patch
          1 kB
          Elliot West

        Activity

          People

            teabot Elliot West
            teabot Elliot West
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: