Add pivot table to table seach #22

Closed
gtowey opened this Issue Apr 24, 2012 · 1 comment

Comments

Projects
None yet
1 participant
Contributor

gtowey commented Apr 24, 2012

functionality exists, just need to make it easier to use

Contributor

gtowey commented Apr 25, 2012

ouch, the hard part is to make this support custom fields for which pivots are much harder to write. For example:

A pivot on Query_time_sum column in the table would result in an expression like:
SUM(IF(hostname_max='host', Query_time_sum, 0)))

But an expression like the average query time SUM(Query_time_sum) / SUM(ts_cnt) is much harder. It would have to be something like:
SUM(IF(hostname_max='host', Query_time_sum, 0))) / SUM(IF(hostname_max='host', ts_cnt, 0)))

Each aggregate function would have to be turned into an IF()

The question is if we can do that kind of parsing reliably.

One idea is to require that custom fields define their own pivot operation -- otherwise they cannot be used.

@gtowey gtowey closed this in d37bfd5 Apr 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment