Need shard key fields for a table

(Ported from the memsql-public-chat Slack channel)

Jason [1:46 PM]
Where in the system catalog can I find the shard key field(s) for a table?

alec [1:56 PM]
@Jason, have to do show create table x; to get the full definition incl shard key

Jason [4 days ago]
Is there no way to query the catalog from SQL? When our application connects, we query the catalog to find the list of tables, columns, data types, etc. Looking to include the shard fields in that list.

Jason [4 days ago]
We use that information when we generate our SQL.

Jason [4 days ago]
@alec?

Jason [1 day ago]
@alec Do we have any other options here? I am looking to, in a single SQL query, determine the shard keys.

Jason [1 day ago]
Never mind, I opened a ticket and got an answer. For anyone following along, this query should satisfy our requirements

SELECT TABLE_SCHEMA AS DATABASE_NAME, TABLE_NAME, COLUMN_NAME, INDEX_TYPE 
FROM INFORMATION_SCHEMA.STATISTICS 
WHERE INDEX_TYPE = 'SHARD';