Add read from file for spark serializer