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

Test failure in sqllogictest aggregates_topk.slt on mac #8845

Closed
alamb opened this issue Jan 12, 2024 · 4 comments · Fixed by #8998
Closed

Test failure in sqllogictest aggregates_topk.slt on mac #8845

alamb opened this issue Jan 12, 2024 · 4 comments · Fixed by #8998
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Jan 12, 2024

Describe the bug

sqllogic

External error: query result mismatch:
[SQL] select trace_id, other, MIN(timestamp) from traces group by trace_id, other order by MIN(timestamp) asc limit 4;
[Diff] (-expected|+actual)
    a -1 -1
    b 0 0
    NULL 0 0
-   c 1 1
+   a 1 1
at test_files/aggregate.slt:2566

To Reproduce

I run this on my Mac M3:

cargo test --test sqllogictests

Expected behavior

The test should pass

Additional context

No response

@alamb alamb added the bug Something isn't working label Jan 12, 2024
@alamb alamb changed the title Test failure in sqllogictest test_files/aggregate.slt:2566 on Mac Test failure in sqllogictest aggregates_topk.slt on mac Jan 25, 2024
@alamb
Copy link
Contributor Author

alamb commented Jan 25, 2024

@mustafasrepo moved this intermittent test to aggregates_topk.slt to isolate the problem more in #8948

@avantgardnerio this is now coming up in new PRs -- e.g. #8993

Can you suggest some way to make these tests deterministic (maybe we need to add a few more rows or adjust N so the top K rows are well defined in all cases?

@avantgardnerio
Copy link
Contributor

@alamb , sorry for the flaky test 😞 . I can think of two solutions:

  1. turn this into a unit test that asserts content, but not order
  2. go all the way and implement multiple order bys with OwnedRow and add a 2nd order by to the test

@mustafasrepo
Copy link
Contributor

mustafasrepo commented Jan 25, 2024

What about changing timestamp field in the table so that, it is unique (hence MIN(timestamp) will generate different results for each different distinct group).

@mustafasrepo
Copy link
Contributor

mustafasrepo commented Jan 25, 2024

What about changing timestamp field in the table so that, it is unique (hence MIN(timestamp) will generate different results for each different distinct group).

Filed a mini PR8998 implementing this suggestion. It will be nice if you have time to double check whether result is indeed deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants