And just tweak the ARRAY_FACTORY initialization to check for PDataType.getCodec(). If there's a codec, then you could delegate to the codec to get the PhoenixArrayFactory.