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

Bug in influx v1 shell: Values presented in a bad way depending on what format is used #526

Open
elofu17 opened this issue Mar 5, 2024 · 0 comments

Comments

@elofu17
Copy link

elofu17 commented Mar 5, 2024

Summary:
Values larger than 999 999 should not be presented as "1.228442e+06" but "1228442.0000000000".

Info + how to reproduce:
I run the latest version of influx CLI on a Debian 11 machine (package: influxdb2-cli 2.7.3-1).

# influx version
Influx CLI dev (git: none) build_date: 2023-04-28T14:24:14Z

I run the v1 shell and connect to my InfluxDB v2 (also latest version, on the same Debian 11 machine).

# influx v1 shell
InfluxQL Shell dev
Connected to InfluxDB OSS v2.7.5
> use Main
> precision rfc3339
> format table
> SELECT * FROM disk ORDER BY time DESC LIMIT 10;
Interactive Table View (press q to exit mode, shift+up/down to navigate tables):
Name: disk
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ index ┃         time         ┃  device   ┃         free          ┃ fstype ┃      host      ┃    inodes_free     ┃    inodes_total    ┃    inodes_used    ┃ inodes_used_percent ┃ mode ┃ path ┃         total          ┃               >┃
┣━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━┫
┃      1┃2024-03-05T12:09:30Z  ┃nvme0n1p1  ┃   961736704.0000000000┃ext4    ┃thengel2        ┃  1228442.0000000000┃  1302528.0000000000┃   74086.0000000000┃         5.6878623722┃rw    ┃/     ┃  20893278208.0000000000┃               >┃
┃      2┃2024-03-05T12:09:30Z  ┃nvme0n1p1  ┃  4836794368.0000000000┃ext4    ┃metricscentral  ┃   702767.0000000000┃   778240.0000000000┃   75473.0000000000┃         9.6979081003┃rw    ┃/     ┃  12442218496.0000000000┃               >┃
┃      3┃2024-03-05T12:09:30Z  ┃nvme0n1p1  ┃  7775858688.0000000000┃ext4    ┃puppet-master2  ┃  2074388.0000000000┃  2285568.0000000000┃  211180.0000000000┃         9.2397163418┃rw    ┃/     ┃  36742631424.0000000000┃               >┃
┃      4┃2024-03-05T12:09:00Z  ┃nvme0n1p1  ┃  4837105664.0000000000┃ext4    ┃metricscentral  ┃   702767.0000000000┃   778240.0000000000┃   75473.0000000000┃         9.6979081003┃rw    ┃/     ┃  12442218496.0000000000┃               >┃
┃      5┃2024-03-05T12:09:00Z  ┃nvme0n1p1  ┃  7776018432.0000000000┃ext4    ┃puppet-master2  ┃  2074388.0000000000┃  2285568.0000000000┃  211180.0000000000┃         9.2397163418┃rw    ┃/     ┃  36742631424.0000000000┃               >┃
┃      6┃2024-03-05T12:09:00Z  ┃nvme0n1p1  ┃   962936832.0000000000┃ext4    ┃thengel2        ┃  1228442.0000000000┃  1302528.0000000000┃   74086.0000000000┃         5.6878623722┃rw    ┃/     ┃  20893278208.0000000000┃               >┃
┃      7┃2024-03-05T12:08:30Z  ┃nvme0n1p1  ┃  7776190464.0000000000┃ext4    ┃puppet-master2  ┃  2074388.0000000000┃  2285568.0000000000┃  211180.0000000000┃         9.2397163418┃rw    ┃/     ┃  36742631424.0000000000┃               >┃
┃      8┃2024-03-05T12:08:30Z  ┃nvme0n1p1  ┃   963375104.0000000000┃ext4    ┃thengel2        ┃  1228442.0000000000┃  1302528.0000000000┃   74086.0000000000┃         5.6878623722┃rw    ┃/     ┃  20893278208.0000000000┃               >┃
┃      9┃2024-03-05T12:08:30Z  ┃nvme0n1p1  ┃  4845699072.0000000000┃ext4    ┃metricscentral  ┃   702767.0000000000┃   778240.0000000000┃   75473.0000000000┃         9.6979081003┃rw    ┃/     ┃  12442218496.0000000000┃               >┃
┃     10┃2024-03-05T12:08:00Z  ┃nvme0n1p1  ┃   963837952.0000000000┃ext4    ┃thengel2        ┃  1228442.0000000000┃  1302528.0000000000┃   74086.0000000000┃         5.6878623722┃rw    ┃/     ┃  20893278208.0000000000┃               >┃
┣━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━┻━━━━━━┻━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┫
                                                                                               ^^^^^^^^^^^^^^^^^^

Look att e.g. column 'indoes_free'. Everything looks good so far. :-)

Now, change format to column or csv and re-run the query:

> format column
> SELECT * FROM disk ORDER BY time DESC LIMIT 10;
name: disk
time                 device    free            fstype host           inodes_free  inodes_total inodes_used inodes_used_percent mode path total            used             used_percent
----                 ------    ----            ------ ----           -----------  ------------ ----------- ------------------- ---- ---- -----            ----             ------------
2024-03-05T12:10:00Z nvme0n1p1 9.61327104e+08  ext4   thengel2       1.228442e+06 1.302528e+06 74086       5.687862372248428   rw   /    2.0893278208e+10 1.897701376e+10  95.17850000380051
2024-03-05T12:10:00Z nvme0n1p1 4.836651008e+09 ext4   metricscentral 702767       778240       75473       9.697908100328947   rw   /    1.2442218496e+10 6.99426816e+09   59.11855250366291
2024-03-05T12:10:00Z nvme0n1p1 7.7756416e+09   ext4   puppet-master2 2.074388e+06 2.285568e+06 211180      9.23971634184588    rw   /    3.6742631424e+10 2.7367825408e+10 77.87457453122093
2024-03-05T12:09:30Z nvme0n1p1 4.836794368e+09 ext4   metricscentral 702767       778240       75473       9.697908100328947   rw   /    1.2442218496e+10 6.9941248e+09    59.117340763493246
2024-03-05T12:09:30Z nvme0n1p1 7.775858688e+09 ext4   puppet-master2 2.074388e+06 2.285568e+06 211180      9.23971634184588    rw   /    3.6742631424e+10 2.736760832e+10  77.87395681185947
2024-03-05T12:09:30Z nvme0n1p1 9.61736704e+08  ext4   thengel2       1.228442e+06 1.302528e+06 74086       5.687862372248428   rw   /    2.0893278208e+10 1.897660416e+10  95.17644567037932
2024-03-05T12:09:00Z nvme0n1p1 7.776018432e+09 ext4   puppet-master2 2.074388e+06 2.285568e+06 211180      9.23971634184588    rw   /    3.6742631424e+10 2.7367448576e+10 77.87350226365008
2024-03-05T12:09:00Z nvme0n1p1 9.62936832e+08  ext4   thengel2       1.228442e+06 1.302528e+06 74086       5.687862372248428   rw   /    2.0893278208e+10 1.8975404032e+10 95.17042647345524
2024-03-05T12:09:00Z nvme0n1p1 4.837105664e+09 ext4   metricscentral 702767       778240       75473       9.697908100328947   rw   /    1.2442218496e+10 6.993813504e+09  59.11470955626768
2024-03-05T12:08:30Z nvme0n1p1 9.63375104e+08  ext4   thengel2       1.228442e+06 1.302528e+06 74086       5.687862372248428   rw   /    2.0893278208e+10 1.897496576e+10  95.16822833669455
                                                                     ^^^^^^^^^^^^

Now look at the numbers in the same column (and other columns).
With format column or csv I get ugly looking values, like "1.228442e+06".
Numbers larger than 999 999 seem to show up as "e+06".
When I swap back to format table or json I get sane looking values, like "1228442.0000000000".

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

No branches or pull requests

1 participant