fleet
fleet copied to clipboard
Fleet UI sorts number values as strings for aliased columns
Fleet version: 4.58.0
Web browser and operating system: n/a
💥 Actual behavior
If a sql query contains an aliased column, the UI will sort this as a string rather than a number (ie: the field type is not inferred correctly).
see https://fleetdm.slack.com/archives/C019WG4GH0A/p1729268053391609
🧑💻 Steps to reproduce
- Create a query like:
SELECT pid, name, ROUND((total_size * '10e-7'), 2) AS memory_used FROM processes ORDER BY total_size DESC LIMIT 10;
- execute the query as a live query
- note the output of the
memory_used
column when sorted
🕯️ More info (optional)
The workaround could be to add an ORDER BY operator in the query itself to do the sort, but having the sort option in the UI would be preferred.