You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mustafasrepo (via GitHub)" <gi...@apache.org> on 2023/12/13 12:51:24 UTC
[PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
mustafasrepo opened a new pull request, #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #.
## Rationale for this change
While working on another PR, I realized that some of the test results are not deterministic. This PR makes these test results deterministic.
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
## Are these changes tested?
Existing tests should work
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
Posted by "mustafasrepo (via GitHub)" <gi...@apache.org>.
mustafasrepo commented on code in PR #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525#discussion_r1426215967
##########
datafusion/sqllogictest/test_files/distinct_on.slt:
##########
@@ -38,17 +38,17 @@ LOCATION '../../testing/data/csv/aggregate_test_100.csv'
# Basic example: distinct on the first column project the second one, and
# order by the third
query TI
-SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3;
+SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3, c9;
Review Comment:
Indeed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
Posted by "mustafasrepo (via GitHub)" <gi...@apache.org>.
mustafasrepo commented on PR #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525#issuecomment-1855200510
> Quite curious, if the test is not deterministic, why we did not fail on this test before?
>
> Oh, I think probably because of `set datafusion.execution.target_partitions = 1;`
>
> Maybe we can remove unneccessary `set datafusion.execution.target_partitions = 1;` before test, so we know what test need specific setting easily.
Yes, because setting is not random. Results are deterministicat each run. However, also in terms of query specifications some results are not certain. For instance for the query
```sql
SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3;
```
Both
```
a 5
b 4
c 2
d 1
e 3
```
and
```
a 4
b 4
c 2
d 1
e 3
```
are valid. However for query
```sql
SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3, c9;
```
only valid result is
```
a 4
b 4
c 2
d 1
e 3
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
Posted by "mustafasrepo (via GitHub)" <gi...@apache.org>.
mustafasrepo merged PR #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525#issuecomment-1854019406
Quite curious, if the test is not deterministic, why we did not fail on this test before?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR]: Make some slt tests deterministic [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #8525:
URL: https://github.com/apache/arrow-datafusion/pull/8525#discussion_r1425769320
##########
datafusion/sqllogictest/test_files/distinct_on.slt:
##########
@@ -38,17 +38,17 @@ LOCATION '../../testing/data/csv/aggregate_test_100.csv'
# Basic example: distinct on the first column project the second one, and
# order by the third
query TI
-SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3;
+SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3, c9;
Review Comment:
I think changing the order by changes the results because DISTINCT ON basically picks the first values for each of the distinct values (of c1) in this case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org