Uploaded image for project: 'Apache Gobblin'
  1. Apache Gobblin
  2. GOBBLIN-1826

Fix bug in Hive registration code where fields could be miscasted in types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • gobblin-core
    • None

    Description

      After the Guava 20 upgrade, there was a major bug in the Hive registration code where fields could be casted as an unexpected type in HiveRegistrationUnit 

      protected static <T> Optional<T> populateField(State state, String key, TypeToken<T> token) {
       

      The field setter is returning an Optional generic, which allows the code to compile but fail during runtime as the types are mismatched, leading to a casting exception when reading the type e.g.

       java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long at org.apache.gobblin.hive.metastore.HiveMetaStoreUtils.getTable(HiveMetaStoreUtils.java:111) 

      Attachments

        Activity

          People

            abti Abhishek Tiwari
            wlo William Lo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m