[NO ISSUE][OM] Move BuiltinTypeMap to asterix-om module

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

Details:
Move BuiltinTypeMap from asterix-metadata to asterix-om
for more visibility among other modules located lower in
the dependency tree.

Change-Id: Ie071e83b3972cd0e4bf78a5083ee9c7bbf1950dd
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17658
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
Tested-by: Hussain Towaileb <hussainht@gmail.com>
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
index c54cdc1..f84a3b7 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
@@ -40,7 +40,6 @@
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Datatype;
 import org.apache.asterix.metadata.utils.MetadataConstants;
 import org.apache.asterix.metadata.utils.TypeUtil;
@@ -50,6 +49,7 @@
 import org.apache.asterix.om.types.AUnorderedListType;
 import org.apache.asterix.om.types.AbstractCollectionType;
 import org.apache.asterix.om.types.AbstractComplexType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.types.TypeSignature;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
index 04db82e..967f99f 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
@@ -29,12 +29,12 @@
 import org.apache.asterix.lang.common.expression.TypeExpression;
 import org.apache.asterix.lang.common.expression.TypeReferenceExpression;
 import org.apache.asterix.lang.common.statement.CreateViewStatement;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Index;
 import org.apache.asterix.metadata.utils.KeyFieldTypeUtil;
 import org.apache.asterix.om.typecomputer.impl.TypeComputeUtils;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.utils.RecordUtil;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -55,21 +55,15 @@
     /**
      * Validates the field that will be used as filter for the components of an LSM index.
      *
-     * @param recordType
-     *            the record type
-     * @param metaType
-     *            the meta record type
-     * @param filterSourceIndicator
-     *            indicates where the filter attribute comes from, 0 for record, 1 for meta record.
-     *            since this method is called only when a filter field presents, filterSourceIndicator will not be null
-     *
-     * @param filterField
-     *            the full name of the field
+     * @param recordType            the record type
+     * @param metaType              the meta record type
+     * @param filterSourceIndicator indicates where the filter attribute comes from, 0 for record, 1 for meta record.
+     *                              since this method is called only when a filter field presents, filterSourceIndicator will not be null
+     * @param filterField           the full name of the field
      * @param sourceLoc
-     * @throws AlgebricksException
-     *             if field is not found in record.
-     *             if field type can't be a filter type.
-     *             if field type is nullable.
+     * @throws AlgebricksException if field is not found in record.
+     *                             if field type can't be a filter type.
+     *                             if field type is nullable.
      */
     public static void validateFilterField(ARecordType recordType, ARecordType metaType, Integer filterSourceIndicator,
             List<String> filterField, SourceLocation sourceLoc) throws AlgebricksException {
@@ -107,24 +101,18 @@
     /**
      * Validates the partitioning expression that will be used to partition a dataset and returns expression type.
      *
-     * @param recType
-     *            the record type
-     * @param metaRecType
-     *            the meta record type
-     * @param partitioningExprs
-     *            a list of partitioning expressions that will be validated
-     * @param keySourceIndicators
-     *            the key sources (record vs. meta)
-     * @param autogenerated
-     *            true if auto generated, false otherwise
+     * @param recType             the record type
+     * @param metaRecType         the meta record type
+     * @param partitioningExprs   a list of partitioning expressions that will be validated
+     * @param keySourceIndicators the key sources (record vs. meta)
+     * @param autogenerated       true if auto generated, false otherwise
      * @param sourceLoc
      * @return a list of partitioning expressions types
-     * @throws AlgebricksException
-     *             if composite key is autogenerated.
-     *             if autogenerated and of a type that can't be autogenerated.
-     *             if a field could not be found in its record type.
-     *             if partitioning key is nullable.
-     *             if the field type can't be a primary key.
+     * @throws AlgebricksException if composite key is autogenerated.
+     *                             if autogenerated and of a type that can't be autogenerated.
+     *                             if a field could not be found in its record type.
+     *                             if partitioning key is nullable.
+     *                             if the field type can't be a primary key.
      */
     public static List<IAType> validatePartitioningExpressions(ARecordType recType, ARecordType metaRecType,
             List<List<String>> partitioningExprs, List<Integer> keySourceIndicators, boolean autogenerated,
@@ -234,14 +222,10 @@
     /**
      * Validates the key fields that will be used as keys of an index.
      *
-     * @param indexType
-     *            the type of the index that its key fields is being validated
-     * @param fieldType
-     *            a key field type
-     * @param displayFieldName
-     *            a field name to use for error reporting
-     * @param sourceLoc
-     *            the source location
+     * @param indexType        the type of the index that its key fields is being validated
+     * @param fieldType        a key field type
+     * @param displayFieldName a field name to use for error reporting
+     * @param sourceLoc        the source location
      * @throws AlgebricksException
      */
     public static void validateIndexFieldType(IndexType indexType, IAType fieldType, List<String> displayFieldName,
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 9f292e7..21ce833 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -170,7 +170,6 @@
 import org.apache.asterix.metadata.dataset.hints.DatasetHints;
 import org.apache.asterix.metadata.dataset.hints.DatasetHints.DatasetNodegroupCardinalityHint;
 import org.apache.asterix.metadata.declared.MetadataProvider;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.CompactionPolicy;
 import org.apache.asterix.metadata.entities.Dataset;
 import org.apache.asterix.metadata.entities.DatasourceAdapter;
@@ -203,6 +202,7 @@
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.types.TypeSignature;
 import org.apache.asterix.om.utils.RecordUtil;
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/FunctionUtil.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/FunctionUtil.java
index cce0bd8..742cd82 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/FunctionUtil.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/FunctionUtil.java
@@ -48,12 +48,12 @@
 import org.apache.asterix.lang.common.expression.UnorderedListTypeDefinition;
 import org.apache.asterix.lang.common.statement.FunctionDecl;
 import org.apache.asterix.metadata.declared.MetadataProvider;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Dataverse;
 import org.apache.asterix.metadata.entities.Function;
 import org.apache.asterix.om.functions.BuiltinFunctionInfo;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.TypeSignature;
 import org.apache.asterix.om.utils.ConstantExpressionUtil;
 import org.apache.commons.lang3.mutable.Mutable;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
index d7637f4..c1eba7c 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -52,7 +52,6 @@
 import org.apache.asterix.metadata.MetadataNode;
 import org.apache.asterix.metadata.MetadataTransactionContext;
 import org.apache.asterix.metadata.api.IMetadataIndex;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.CompactionPolicy;
 import org.apache.asterix.metadata.entities.Dataset;
 import org.apache.asterix.metadata.entities.DatasourceAdapter;
@@ -69,6 +68,7 @@
 import org.apache.asterix.metadata.utils.MetadataConstants;
 import org.apache.asterix.metadata.utils.MetadataUtil;
 import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.runtime.formats.NonTaggedDataFormat;
 import org.apache.asterix.transaction.management.opcallbacks.PrimaryIndexOperationTrackerFactory;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Datatype.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Datatype.java
index 8e5dbd9..014f870 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Datatype.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Datatype.java
@@ -20,9 +20,13 @@
 package org.apache.asterix.metadata.entities;
 
 import org.apache.asterix.common.metadata.DataverseName;
+import org.apache.asterix.common.transactions.TxnId;
 import org.apache.asterix.metadata.MetadataCache;
+import org.apache.asterix.metadata.MetadataNode;
 import org.apache.asterix.metadata.api.IMetadataEntity;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 
 /**
  * Metadata describing a datatype.
@@ -69,4 +73,16 @@
     public Datatype dropFromCache(MetadataCache cache) {
         return cache.dropDatatype(this);
     }
+
+    public static IAType getTypeFromTypeName(MetadataNode metadataNode, TxnId txnId, DataverseName dataverseName,
+            String typeName) throws AlgebricksException {
+        IAType type = BuiltinTypeMap.getBuiltinType(typeName);
+        if (type == null) {
+            Datatype dt = metadataNode.getDatatype(txnId, dataverseName, typeName);
+            if (dt != null) {
+                type = dt.getDatatype();
+            }
+        }
+        return type;
+    }
 }
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
index 3950053..43fec57 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
@@ -44,7 +44,6 @@
 import org.apache.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
 import org.apache.asterix.metadata.bootstrap.MetadataRecordTypes;
 import org.apache.asterix.metadata.dataset.DatasetFormatInfo;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Dataset;
 import org.apache.asterix.metadata.entities.ExternalDatasetDetails;
 import org.apache.asterix.metadata.entities.InternalDatasetDetails;
@@ -73,6 +72,7 @@
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.AUnorderedListType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.runtime.compression.CompressionManager;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
index 454cc55..d10d25b 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
@@ -26,7 +26,6 @@
 import org.apache.asterix.metadata.MetadataNode;
 import org.apache.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
 import org.apache.asterix.metadata.bootstrap.MetadataRecordTypes;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Datatype;
 import org.apache.asterix.metadata.utils.TypeUtil;
 import org.apache.asterix.om.base.ABoolean;
@@ -38,6 +37,7 @@
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.AUnorderedListType;
 import org.apache.asterix.om.types.AbstractComplexType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -112,7 +112,7 @@
                         }
 
                         IAType fieldType =
-                                BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, fieldTypeName);
+                                Datatype.getTypeFromTypeName(metadataNode, txnId, dataverseName, fieldTypeName);
                         fieldTypes[fieldId] = TypeUtil.createQuantifiedType(fieldType, isNullable, isMissable);
                         fieldId++;
                     }
@@ -123,17 +123,16 @@
                     String unorderedlistTypeName = ((AString) derivedTypeRecord
                             .getValueByPos(MetadataRecordTypes.DERIVEDTYPE_ARECORD_UNORDEREDLIST_FIELD_INDEX))
                                     .getStringValue();
-                    return new Datatype(dataverseName, datatypeName,
-                            new AUnorderedListType(BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId,
-                                    dataverseName, unorderedlistTypeName), datatypeName),
-                            isAnonymous);
+                    return new Datatype(dataverseName, datatypeName, new AUnorderedListType(
+                            Datatype.getTypeFromTypeName(metadataNode, txnId, dataverseName, unorderedlistTypeName),
+                            datatypeName), isAnonymous);
                 }
                 case ORDEREDLIST: {
                     String orderedlistTypeName = ((AString) derivedTypeRecord
                             .getValueByPos(MetadataRecordTypes.DERIVEDTYPE_ARECORD_ORDEREDLIST_FIELD_INDEX))
                                     .getStringValue();
                     return new Datatype(dataverseName, datatypeName, new AOrderedListType(
-                            BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, orderedlistTypeName),
+                            Datatype.getTypeFromTypeName(metadataNode, txnId, dataverseName, orderedlistTypeName),
                             datatypeName), isAnonymous);
                 }
                 default:
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
index ef9c143..3a5217b 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
@@ -55,7 +55,6 @@
 import org.apache.asterix.metadata.MetadataNode;
 import org.apache.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
 import org.apache.asterix.metadata.bootstrap.MetadataRecordTypes;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Function;
 import org.apache.asterix.om.base.ABoolean;
 import org.apache.asterix.om.base.ANull;
@@ -68,6 +67,7 @@
 import org.apache.asterix.om.types.AOrderedListType;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.TypeSignature;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.common.utils.Triple;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
index 43d0ed6..a50a834 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
@@ -43,8 +43,8 @@
 import org.apache.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
 import org.apache.asterix.metadata.bootstrap.MetadataRecordTypes;
 import org.apache.asterix.metadata.declared.MetadataManagerUtil;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Dataset;
+import org.apache.asterix.metadata.entities.Datatype;
 import org.apache.asterix.metadata.entities.Index;
 import org.apache.asterix.metadata.utils.KeyFieldTypeUtil;
 import org.apache.asterix.om.base.ABoolean;
@@ -299,7 +299,7 @@
                 case STRING:
                     // This is a simple element, place in a single-element list.
                     String typeName = ((AString) fieldTypeItem).getStringValue();
-                    IAType fieldType = BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, typeName);
+                    IAType fieldType = Datatype.getTypeFromTypeName(metadataNode, txnId, dataverseName, typeName);
                     searchKeyType.add(Collections.singletonList(fieldType));
                     break;
                 case ARRAY:
@@ -309,8 +309,7 @@
                     IACursor fieldTypeListCursor = fieldTypeList.getCursor();
                     while (fieldTypeListCursor.next()) {
                         typeName = ((AString) fieldTypeListCursor.get()).getStringValue();
-                        fieldTypes
-                                .add(BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, typeName));
+                        fieldTypes.add(Datatype.getTypeFromTypeName(metadataNode, txnId, dataverseName, typeName));
                     }
                     searchKeyType.add(fieldTypes);
                     break;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalFunctionCompilerUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
index ce98008..0c5315c 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
@@ -27,11 +27,11 @@
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.functions.ExternalFunctionLanguage;
 import org.apache.asterix.metadata.declared.MetadataProvider;
-import org.apache.asterix.metadata.entities.BuiltinTypeMap;
 import org.apache.asterix.metadata.entities.Function;
 import org.apache.asterix.om.functions.IExternalFunctionInfo;
 import org.apache.asterix.om.typecomputer.base.IResultTypeComputer;
 import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.BuiltinTypeMap;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.types.TypeSignature;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/BuiltinTypeMap.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinTypeMap.java
similarity index 81%
rename from asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/BuiltinTypeMap.java
rename to asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinTypeMap.java
index 2dcea99..8693109 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/BuiltinTypeMap.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinTypeMap.java
@@ -17,20 +17,13 @@
  * under the License.
  */
 
-package org.apache.asterix.metadata.entities;
+package org.apache.asterix.om.types;
 
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.asterix.common.metadata.DataverseName;
-import org.apache.asterix.common.transactions.TxnId;
-import org.apache.asterix.metadata.MetadataNode;
-import org.apache.asterix.om.types.BuiltinType;
-import org.apache.asterix.om.types.IAType;
-import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-
 /**
  * Maps from a string representation of an Asterix type to an Asterix type.
  */
@@ -90,16 +83,4 @@
     public static Set<BuiltinType> getAllBuiltinTypes() {
         return new HashSet<>(_builtinTypeMap.values());
     }
-
-    public static IAType getTypeFromTypeName(MetadataNode metadataNode, TxnId txnId, DataverseName dataverseName,
-            String typeName) throws AlgebricksException {
-        IAType type = _builtinTypeMap.get(typeName);
-        if (type == null) {
-            Datatype dt = metadataNode.getDatatype(txnId, dataverseName, typeName);
-            if (dt != null) {
-                type = dt.getDatatype();
-            }
-        }
-        return type;
-    }
 }