[NO-ISSUE][IDX] Typo + style fix for array indexing change.

- user model change: no
- storage format changes: no
- interface changes: no

Fixing "missable" typo in KeyFieldTypeUtil and using better
comparison for enum types in MetadataNode.

Change-Id: Ic04892288d257fdfcf98ac5cfb87e79135b2907a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/10928
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
index c769960..29acbda 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
@@ -1244,7 +1244,7 @@
                 //   we may need to include the dataverse of the full-text config in the index.getFullTextConfigDataverse()
                 //   and instead of checking index.getDataverseName(), we need to check index.getFullTextConfigDataverse()
                 //   to see if it is the same as the dataverse of the full-text config
-                if (index.getIndexDetails() instanceof Index.TextIndexDetails) {
+                if (Index.IndexCategory.of(index.getIndexType()) == Index.IndexCategory.TEXT) {
                     String indexConfigName = ((Index.TextIndexDetails) index.getIndexDetails()).getFullTextConfigName();
                     if (index.getDataverseName().equals(dataverseNameFullTextConfig)
                             && !Strings.isNullOrEmpty(indexConfigName) && indexConfigName.equals(configName)) {
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/KeyFieldTypeUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/KeyFieldTypeUtil.java
index 9458f61..b2026d7 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/KeyFieldTypeUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/KeyFieldTypeUtil.java
@@ -150,7 +150,8 @@
         List<IAType> indexKeyTypes = new ArrayList<>();
         for (Index.ArrayIndexElement e : indexDetails.getElementList()) {
             for (int i = 0; i < e.getProjectList().size(); i++) {
-                ARecordType sourceType = (e.getSourceIndicator() == 0) ? recordType : metaRecordType;
+                ARecordType sourceType =
+                        (e.getSourceIndicator() == Index.RECORD_INDICATOR) ? recordType : metaRecordType;
                 Pair<IAType, Boolean> keyPairType = ArrayIndexUtil.getNonNullableOpenFieldType(e.getTypeList().get(i),
                         ArrayIndexUtil.getFlattenedKeyFieldNames(e.getUnnestList(), e.getProjectList().get(i)),
                         sourceType,
@@ -308,7 +309,7 @@
     public static Triple<IAType, Boolean, Boolean> getKeyProjectType(final ARecordType inputType, List<String> path,
             SourceLocation sourceLoc) throws CompilationException {
         IAType itemType = inputType;
-        boolean itemTypeNullable = false, itemTypeMissalbe = false;
+        boolean itemTypeNullable = false, itemTypeMissable = false;
         for (String step : path) {
             // check that the type is a record at this point
             if (itemType.getTypeTag() != ATypeTag.OBJECT) {
@@ -331,12 +332,12 @@
                 AUnionType fieldTypeUnion = (AUnionType) fieldType;
                 itemType = fieldTypeUnion.getActualType();
                 itemTypeNullable = itemTypeNullable || fieldTypeUnion.isNullableType();
-                itemTypeMissalbe = itemTypeMissalbe || fieldTypeUnion.isMissableType();
+                itemTypeMissable = itemTypeMissable || fieldTypeUnion.isMissableType();
             } else {
                 itemType = fieldType;
             }
         }
-        return new Triple<>(itemType, itemTypeNullable, itemTypeMissalbe);
+        return new Triple<>(itemType, itemTypeNullable, itemTypeMissable);
     }
 
     public static IAType makeUnknownableType(IAType primeType, boolean nullable, boolean missable) {