use of org.apache.asterix.om.types.BuiltinType in project asterixdb by apache.
the class MetadataNode method getNestedComplexDatatypeNamesForThisDatatype.
private List<String> getNestedComplexDatatypeNamesForThisDatatype(JobId jobId, String dataverseName, String datatypeName) throws MetadataException, RemoteException {
//Return all field types that aren't builtin types
Datatype parentType = getDatatype(jobId, dataverseName, datatypeName);
List<IAType> subTypes = null;
if (parentType.getDatatype().getTypeTag() == ATypeTag.OBJECT) {
ARecordType recType = (ARecordType) parentType.getDatatype();
subTypes = Arrays.asList(recType.getFieldTypes());
} else if (parentType.getDatatype().getTypeTag() == ATypeTag.UNION) {
AUnionType recType = (AUnionType) parentType.getDatatype();
subTypes = recType.getUnionList();
}
List<String> nestedTypes = new ArrayList<>();
if (subTypes != null) {
for (IAType subType : subTypes) {
if (!(subType instanceof BuiltinType)) {
nestedTypes.add(subType.getTypeName());
}
}
}
return nestedTypes;
}
Aggregations