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

Types: Remove hash-lookup from PrimitiveTypeInfo::getPrimitiveCategory()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.0
    • Fix Version/s: None
    • Component/s: Types
    • Labels:

      Description

        public PrimitiveCategory getPrimitiveCategory() {
          return getPrimitiveTypeEntry().primitiveCategory;
        }
      
        public PrimitiveTypeEntry getPrimitiveTypeEntry() {
          return PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(typeName);
        }
      
      
        /**
         * Get the TypeEntry for the given base type name (int, varchar, etc).
         */
        public static PrimitiveTypeEntry getTypeEntryFromTypeName(String typeName) {
          return typeNameToTypeEntry.get(typeName);
        }
      
        // Base type name to PrimitiveTypeEntry map.
        private static final Map<String, PrimitiveTypeEntry> typeNameToTypeEntry = new HashMap<String, PrimitiveTypeEntry>();
      

      Not even a single intern() call there. SMH.

        Attachments

        1. HIVE-14201.1.patch
          1 kB
          Gopal Vijayaraghavan

          Activity

            People

            • Assignee:
              gopalv Gopal Vijayaraghavan
              Reporter:
              gopalv Gopal Vijayaraghavan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: