Query return types

Is json the only format that TigerGraph can return from a query, or is it possible to return object arrays?

Yup. Only JSON. It can store csv to file, but that is probably not what you are looking for.

I’ve hacked together a tabular output in the past. Can you elaborate on what you are looking for?

The question was partially out of curiosity. What we’ve done in the past pulling data from SQL Server - that fastest way to fetch data is to loop through the rows of the resultset and pull each row as an object array - and return those as an array of object arrays. We have a custom code-gen tool that knows exactly how to consume these object arrays client side. This gave us the fastest way to pull data from the database and the smallest size data to send across the wire.

Even if we could pull object arrays from a graph, I don’t know if this would be usable. Its straightforward when pulling from a relational db but maybe not coming from a graph db.

So, you can compose a global accumulator as a LIST of TUPLES, and print that. It will end up wrapped in our standard return types, but unwrapping that is reasonably straightforward.

See if this helps: https://docs.tigergraph.com/dev/gsql-ref/querying/output-statements-and-file-objects#json-format-values

Thank you, Richard,

This is helping me get my arms around what the options and possibilities are for designing frameworks and apps that will consume TG output.