fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Fleet UI sorts number values as strings for aliased columns

Open dherder opened this issue 4 months ago • 0 comments

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

  1. 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;
  1. execute the query as a live query
  2. 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.

dherder avatar Oct 18 '24 16:10 dherder