brimdata / super

An analytics database that puts JSON and relational tables on equal footing
https://zed.brimdata.io/
BSD 3-Clause "New" or "Revised" License
1.39k stars 67 forks source link

support COUNT(*) #5488

Closed mccanne closed 3 days ago

mccanne commented 3 days ago

This commit adds syntax support for COUNT(*) and updates the vam/sam count logic to count only values that are not errors or nulls.

philrz commented 3 days ago

Verified in super commit 222ded6.

Before:

$ super -version
Version: v1.18.0-158-g1aa08f35

$ super -c "SELECT COUNT(*)
FROM 'products.csv';"
parse error at line 1, column 14:
SELECT COUNT(*)
         === ^ ===

Now:

$ super -version
Version: v1.18.0-159-g222ded63

$ super -c "SELECT COUNT(*)
FROM 'products.csv';"
{count:77(uint64)}

Thanks @mccanne!