ASTERIXDB-1587 Made upsert look in the correct dataverse for datatypes
Change-Id: Iccf04c2210a1535cd7de6eeea88dfefec9ba206a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1085
Reviewed-by: Preston Carman <prestonc@apache.org>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/AqlMetadataProvider.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/AqlMetadataProvider.java
index a5e5cda..679379b 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/AqlMetadataProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/AqlMetadataProvider.java
@@ -2310,8 +2310,9 @@
String indexName = primaryIndex.getIndexName();
String itemTypeName = dataset.getItemTypeName();
+ String itemTypeDataverseName = dataset.getItemTypeDataverseName();
ARecordType itemType = (ARecordType) MetadataManager.INSTANCE
- .getDatatype(mdTxnCtx, dataSource.getId().getDataverseName(), itemTypeName).getDatatype();
+ .getDatatype(mdTxnCtx, itemTypeDataverseName, itemTypeName).getDatatype();
ARecordType metaItemType = DatasetUtils.getMetaType(this, dataset);
ITypeTraits[] typeTraits = DatasetUtils.computeTupleTypeTraits(dataset, itemType, metaItemType);
IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();