fieldType = subType.getSubFieldType(fieldExpr.first.subList(i, fieldExpr.first.size()));
} else {
if (!stmtCreateIndex.isEnforced() && stmtCreateIndex.getIndexType() != IndexType.BTREE) {
throw new AsterixException(ErrorCode.INDEX_ILLEGAL_NON_ENFORCED_TYPED, sourceLoc,
stmtCreateIndex.getIndexType());
if (stmtCreateIndex.isEnforced() && !fieldExpr.second.isUnknownable()) {
throw new AsterixException(ErrorCode.INDEX_ILLEGAL_ENFORCED_NON_OPTIONAL, sourceLoc,
String.valueOf(fieldExpr.first));
if (stmtCreateIndex.isEnforced()
&& subType.getSubFieldType(fieldExpr.first.subList(i, fieldExpr.first.size())) != null) {
throw new AsterixException(ErrorCode.INDEX_ILLEGAL_ENFORCED_ON_CLOSED_FIELD, sourceLoc,
overridesFieldTypes, stmtCreateIndex.isEnforced(), false, MetadataUtil.PENDING_ADD_OP);
doCreateIndex(hcc, metadataProvider, ds, newIndex, jobFlags, sourceLoc);
} finally {