@Override public void generateNestedDerivedTypeNames() { for (int i = 0; i < fieldTypes.length; i++) { IAType fieldType = fieldTypes[i]; if (fieldType.getTypeTag().isDerivedType() && (fieldType.getTypeName() == null)) { AbstractComplexType nestedType = ((AbstractComplexType) fieldType); nestedType.setTypeName(getTypeName() + "_" + fieldNames[i]); nestedType.generateNestedDerivedTypeNames(); } } }
/** * @param subFieldName The full pathname of the child * @return the type of the child * @throws AsterixException */ public IAType getSubFieldType(List<String> subFieldName) throws AsterixException { IAType subRecordType = getFieldType(subFieldName.get(0)); for (int i = 1; i < subFieldName.size(); i++) { if (subRecordType == null) { return null; } if (subRecordType.getTypeTag().equals(ATypeTag.UNION)) { // enforced SubType subRecordType = ((AUnionType) subRecordType).getNullableType(); if (subRecordType.getTypeTag() != ATypeTag.RECORD) { throw new AsterixException( "Field accessor is not defined for values of type " + subRecordType.getTypeTag()); } } subRecordType = ((ARecordType) subRecordType).getFieldType(subFieldName.get(i)); } return subRecordType; }