def convert(data, first)
      output = data.map(&:to_json).join(',')
      first ? output : ',' + output
    end
def convert(data, first)
      output = data.map(&:to_json).join(',')
      first ? output : ',' + output
    end
Converts the given input data to the JSON format.

 @param [Array] data The data we wish to convert

 @param [Boolean] Is this the first output batch?

 @return [String] The converted input data in the JSON format