gorkem
December 25, 2021, 1:57pm
1
It’s been more than a year since I started using influxdb but could not figure out how to actually print values. for example, I’m reading array documentation and there is an example;
arr = ["1st", "2nd", "3rd"]
arr[0]
// Returns 1st
arr[2]
// Returns 3rd
How do I actually execute this and see the result value myself? I’ve tried influxcli but I don’t think it is possible, right?
Anaisdg
December 28, 2021, 10:57am
2
Hello @gorkem ,
Unfortunately Flux only supports table streams. I believe this was once supported in the REPL.
Please comment on the following issues:
opened 10:56AM - 28 Dec 21 UTC
closed 07:14PM - 28 Dec 21 UTC
Support printing other types like scalars, arrays, etc.
Expectation:
When u… sers use any of the following functions:
http.get()
findRecord()
getRecord
findColumn()
usage.limits
...and any other functions I'm missing.
They must construct a temporary table and map the output to it in order to output these other formats. In otherwords they must use either use array.from() and map() or follow the example here:
https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/http/get/#get-the-status-of-influxdb-oss
Reality:
The query runs, and no output is generated. The extension doesn't provide any errors when running these queries so the users are unaware of the need to search for these hacks. Related to influxdata/flux#4654 and influxdata/vsflux#234
Proposal
Provide support to print other data types.
opened 09:02PM - 08 Jun 21 UTC
enhancement
team/ui
**Proposal:**
Support output from flux functions with data formats other than A… nnotated CSV.
**Current behavior:**
The user can't output or visualize any datatype other than Annotated CSV. This is relevant for any of the following functions:
- [http.get()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/http/get/)
- [findRecord()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/findrecord/)
- [getRecord](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord/)
- [findColumn()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/findcolumn/)
- [usage.limits](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/usage/limits/)
...and any other functions that return different formats that I'm missing.
**Desired behavior:**
Enable users to visualize scalars in the UI when selecting the gauge or single stat visualization type. Output other data formats in the raw data view as txt.
**Use case:**
This lack of format support blocks users from sophisticated Flux development.
**Alternatives**
Include links to documentation with hacks to force visualization in error messages:
- https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/http/get/#get-the-status-of-influxdb-oss
- suggest they use array.from()
opened 08:16PM - 07 Jun 21 UTC
A blocker for users is the ability to use functions that return outputs in forma… ts other than Annotated CSV.
**Expectation:**
When users use any of the following functions:
- [http.get()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/http/get/)
- [findRecord()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/findrecord/)
- [getRecord](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord/)
- [findColumn()](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/findcolumn/)
- [usage.limits](https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/usage/limits/)
...and any other functions I'm missing.
They must construct a temporary table and map the output to it in order to output these other formats. In otherwords they must use either use array.from() and map() or follow the example here:
https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/experimental/http/get/#get-the-status-of-influxdb-oss
**Reality:**
The query runs, and no output is generated. The extension doesn't provide any errors when running these queries so the users are unaware of the need to search for these hacks. Related to influxdata/ui#224.
**Proposal**
Provide support for other data types.
Thanks!
1 Like
Anaisdg
December 28, 2021, 7:49pm
3
@gorkem ,
However you can use array.from() function to generate a table and show the result that way.