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

Different query result to DataExplorer #598

Open
spar7453 opened this issue Jul 28, 2023 · 0 comments
Open

Different query result to DataExplorer #598

spar7453 opened this issue Jul 28, 2023 · 0 comments

Comments

@spar7453
Copy link

spar7453 commented Jul 28, 2023

  • Client Version: 1.37.0
  • InfluxDB Version: v2.7.1
  • Platform: Windows10

Query:

from(bucket:"rust")
|> range(start: 2023-07-28T04:22:00Z, stop: 2023-07-28T04:25:00Z)
|> filter(fn: (r) => r["_measurement"] == "market_snapshot")
|> filter(fn: (r) => r["ticker"] == "TEST1" or r["ticker"] == "TEST2")
|> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
|> keep(columns: ["_time", "ticker", "bid", "bidq", "ask", "askq", "volume"])
|> group()

Expected Behavior:
Query results are sorted based on _time

Actual behavior:
Query results are stacked based on ticker (tag)

result table _time ticker ask askq bid bidq volume
0 _result 0 2023-07-28 04:22:00.027463+00:00 TEST1 34275.0 9693 34265.0 696 0
1 _result 0 2023-07-28 04:22:00.229166+00:00 TEST1 34270.0 246 34265.0 696 0
2 _result 0 2023-07-28 04:22:00.370787+00:00 TEST1 34270.0 246 34265.0 1007 0
3 _result 0 2023-07-28 04:22:01.023661+00:00 TEST1 34270.0 247 34265.0 1007 0
4 _result 0 2023-07-28 04:22:01.083292+00:00 TEST1 34270.0 247 34265.0 1007 20
.. ... ... ... ... ... ... ... ... ...
809 _result 0 2023-07-28 04:24:56.852404+00:00 TEST2 34320.0 10122 34300.0 4355 0
810 _result 0 2023-07-28 04:24:57.046504+00:00 TEST2 34315.0 34 34300.0 4355 0
811 _result 0 2023-07-28 04:24:59.049960+00:00 TEST2 34315.0 72 34300.0 4355 0
812 _result 0 2023-07-28 04:24:59.405875+00:00 TEST2 34315.0 34 34300.0 4355 0
813 _result 0 2023-07-28 04:24:59.882963+00:00 TEST2 34315.0 9784 34300.0 100 0

After sorting

0 _result 0 2023-07-28 04:22:00.027463+00:00 TEST1 34275.0 9693 34265.0 696 0
1 _result 0 2023-07-28 04:22:00.229166+00:00 TEST1 34270.0 246 34265.0 696 0
2 _result 0 2023-07-28 04:22:00.370787+00:00 TEST1 34270.0 246 34265.0 1007 0
552 _result 0 2023-07-28 04:22:00.378335+00:00 TEST2 34320.0 10065 34300.0 4058 0
553 _result 0 2023-07-28 04:22:00.431953+00:00 TEST2 34320.0 10065 34300.0 4058 39
.. ... ... ... ... ... ... ... ... ...
549 _result 0 2023-07-28 04:24:59.393780+00:00 TEST1 34270.0 1148 34260.0 2108 1
550 _result 0 2023-07-28 04:24:59.399117+00:00 TEST1 34270.0 1962 34260.0 1307 0
812 _result 0 2023-07-28 04:24:59.405875+00:00 TEST2 34315.0 34 34300.0 4355 0
551 _result 0 2023-07-28 04:24:59.875531+00:00 TEST1 34270.0 9126 34260.0 825 0
813 _result 0 2023-07-28 04:24:59.882963+00:00 TEST2 34315.0 9784 34300.0 100 0

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