Change this method to not be static and build the kvSchema here like this:
    builder.addField(arrIdxFunc);