Can I access the value of the "table" or "_RESULT" in flux

For reasons I won’t go into here, I’d like to access the “table” number in a map() function.

an example would be

|> universe.map(fn: (r) => ({ r with newColumn: r.table }))

Yet both r.table and r._RESULT don’t yield the expected results because, of course, they are “meta” columns.

How can I do this please?

This, unfortunately, isn’t really possible. That metadata mostly just exists for the csv decoder to reconstruct the tables. It’s hard for us to add a number in the middle of the query because there isn’t a defined order of how group keys are processed. So part of table 0 might be processed after table 1, but it later gets output by the csv encoder first.

2 Likes

That’s a bummer.
I’ll back up a bit and post the reason why I wanted it.

Would there be an alternative (elegant) Flux way of numbering the tables with a sequential number?
I can only think of having a final join() that allocated each unique “_field” with an increasing number