Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting by indirect attributes doesn't work #435

Closed
pcoccoli opened this issue Dec 1, 2023 · 1 comment · Fixed by #436
Closed

Sorting by indirect attributes doesn't work #435

pcoccoli opened this issue Dec 1, 2023 · 1 comment · Fixed by #436
Assignees
Labels
bug Something isn't working

Comments

@pcoccoli
Copy link
Collaborator

pcoccoli commented Dec 1, 2023

Describe the bug
Sort order is lost in DISP for indirect attributes

Details of the bug

p = GET process
    FROM file:///home/pcoccoli/github/kestrel-lang/test-data/doctored-1k.json
    WHERE name in ('conhost.exe', 'services.exe', 'taskhost.exe')
DISP p ATTR binary_ref.name SORT BY binary_ref.name DESC
sp = SORT p BY binary_ref.name DESC
DISP sp ATTR binary_ref.name

The two DISP outputs do not match - the first is sorted correctly; the second is not.

To Reproduce
Run the statements above

Expected behavior
The two DISP outputs should be the same - sorted descending.

Screenshots

binary_ref.name
   taskhost.exe
   services.exe
    conhost.exe

binary_ref.name
   services.exe
    conhost.exe
   taskhost.exe

[SUMMARY] block executed in 1 seconds
VARIABLE    TYPE  #(ENTITIES)  #(RECORDS)  directory*  file*  process*  user-account*
       p process            9           9           8     16        23              8
      sp process            9           9           0      0         0              0
*Number of related records cached.
@pcoccoli pcoccoli added the bug Something isn't working label Dec 1, 2023
@pcoccoli pcoccoli self-assigned this Dec 1, 2023
@pcoccoli
Copy link
Collaborator Author

pcoccoli commented Dec 1, 2023

There are at least 2 places where we have an issue:

  1. firepit's lookup function (used by kestrel in Session.get_variable() via variable.get_entities(). This probably has to be fixed in firepit itself.
  2. DISP itself, more specifically the _build_query() private function it uses loses the sort order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant