ErrorMsg.INVALID_ARRAYINDEX_CONSTANT.getMsg()));
}
// Calculate TypeInfo
TypeInfo t = ((ListTypeInfo) myt).getListElementTypeInfo();
desc = new ExprNodeGenericFuncDesc(t, FunctionRegistry
.getGenericUDFForIndex(), children);
} else if (myt.getCategory() == Category.MAP) {
// Only allow constant map key for now
if (!(children.get(1) instanceof ExprNodeConstantDesc)) {
throw new SemanticException(SemanticAnalyzer.generateErrorMessage(
expr,
ErrorMsg.INVALID_MAPINDEX_CONSTANT.getMsg()));
}
if (!(((ExprNodeConstantDesc) children.get(1)).getTypeInfo()
.equals(((MapTypeInfo) myt).getMapKeyTypeInfo()))) {
throw new SemanticException(ErrorMsg.INVALID_MAPINDEX_TYPE
.getMsg(expr));
}
// Calculate TypeInfo
TypeInfo t = ((MapTypeInfo) myt).getMapValueTypeInfo();
desc = new ExprNodeGenericFuncDesc(t, FunctionRegistry
.getGenericUDFForIndex(), children);
} else {
throw new SemanticException(ErrorMsg.NON_COLLECTION_TYPE.getMsg(expr,
myt.getTypeName()));
}