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

Fix NPE and TApplicationException in function related HiveMetastore methods

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • None
    • None

    Description

      The TestFunctions tests revealed that NPE is thrown in some cases. These NPEs could be prevented with a simple null check and a MetaException with a proper error message should be thrown instead.
      Example: NPE is thrown in the following test cases

      • testCreateFunctionNullFunctionName
      • testCreateFunctionNullDatabaseName
      • testCreateFunctionNullOwnerType
      • testCreateFunctionNullFunctionType
      • testGetFunctionNullDatabase
      • testDropFunctionNullDatabase
      • testDropFunctionNullFunctionName
      • testAlterFunctionNullDatabase
      • testAlterFunctionNullFunctionName
      • testAlterFunctionNullFunction
      • testAlterFunctionNullFunctionNameInNew
      • testAlterFunctionNullDatabaseNameInNew
      • testAlterFunctionNullOwnerTypeInNew
      • testAlterFunctionNullFunctionTypeInNew

      Also there are some alter function tests where InvalidObjectException is thrown with Embedded MetaStore, but TApplicationException it thrown with Remote MetaStore. The reason is that the InvalidObjectException is not defined for the alter_function method in the thrift interface, so we got the TApplicationException when the InvalidObjectException was thrown. In these cases the InvalidObjectException could be handled on the server side and re-throw it as a MetaException

      Attachments

        1. HIVE-19076.3.patch
          21 kB
          Marta Kuczora
        2. HIVE-19076.2.patch
          20 kB
          Marta Kuczora
        3. HIVE-19076.1.patch
          20 kB
          Marta Kuczora

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            kuczoram Marta Kuczora Assign to me
            kuczoram Marta Kuczora
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment