Transforms the results of a Vertica SQL query into JSON