velociraptor icon indicating copy to clipboard operation
velociraptor copied to clipboard

Sorting (and stacking) does not work for boolean values

Open misje opened this issue 10 months ago • 0 comments

I would very much like to stack on booleans, but it appears that sorting is broken for boolean values. Here is a very simple query. The raw response JSON follows, showing that the values are indeed boolean.

SELECT *
FROM parse_csv(accessor='data',
               filename='''Foo,Bar
one,true
two,false
three,true
four,false''')
[
  {
    "Foo": "one",
    "Bar": true
  },
  {
    "Foo": "two",
    "Bar": false
  },
  {
    "Foo": "three",
    "Bar": true
  },
  {
    "Foo": "four",
    "Bar": false
  }
]

I expect rows with Bar=false to be sorted before Bar=true. What about coercing booleans into 0 and 1 when sorting columns?

misje avatar Jun 15 '25 19:06 misje