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

Order result-set columns by query projection ordering #14

Closed
philhofer opened this issue Jun 16, 2023 · 3 comments · Fixed by #16
Closed

Order result-set columns by query projection ordering #14

philhofer opened this issue Jun 16, 2023 · 3 comments · Fixed by #16

Comments

@philhofer
Copy link
Contributor

The "Logs" visualization in Grafana always picks the first non-timestamp column as the log line.
Right now the textual order of the SELECT columns has no effect on the order of the result columns,
which means there isn't really a way to work around this shortcoming in the visualization.
It would be nice if the result order always matched the order presented in the textual query (to the extent that it's possible).

@flobernd
Copy link
Contributor

This seems to be a general Sneller limitation. E.g.

SELECT duration, bytes FROM queries LIMIT 1

[
  {
    duration: 155238520,
    bytes: 53477376
  },
  final_status::{
    hits: 0,
    misses: 0,
    scanned: 0,
    result_set: {
      duration: 65535,
      bytes: 65535
    }
  }
]
SELECT bytes, duration FROM queries LIMIT 1

[
  {
    duration: 155238520,
    bytes: 53477376
  },
  final_status::{
    hits: 0,
    misses: 1,
    scanned: 1048576,
    result_set: {
      bytes: 65535,
      duration: 65535
    }
  }
]

In the result_set annotation field, the order of the SELECT columns is honored, in the actual result rows, it's not.

@philhofer
Copy link
Contributor Author

Right; there isn't a way for us to fix this in the query engine because of the semantics of ion and the fact that we guarantee symbol IDs are sorted within structures. What I'm suggesting is just that the grafana datasource sort the columns in the data frame according to the returned result_set.

@flobernd
Copy link
Contributor

Sounds good. I'll take care!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants