How to achieve count distinct function on elastic search type using sql4es driver?
Select distinct inv_number , count(1) from invoices;
But
Since, the OP is using sql4es jdbc driver, he is asking for a sql query for his use-case :
SELECT COUNT(DISTINCT inv_number) from invoices;
it returns the number of distinct values of the specified column