Skip to content

Conversation

ulysses-you
Copy link
Contributor

What changes were proposed in this pull request?

It should be a bug if spark.sql.optimizer.plannedWrite.enabled enabled, so throw exception in test mode if the ordering does not match to help improve test coverage.

Why are the changes needed?

Make v1 write test work on all SQL tests

Does this PR introduce any user-facing change?

no, only affect tests

How was this patch tested?

pass CI

@github-actions github-actions bot added the SQL label Aug 24, 2022
Copy link
Contributor

@allisonwang-db allisonwang-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ulysses-you this is great! I do see we have a few test failures. Have you looked into them yet?

// V1 write command will be empty).
if (Utils.isTesting) outputOrderingMatched = orderingMatched
if (Utils.isTesting) {
if (SQLConf.get.plannedWriteEnabled && !orderingMatched) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to check the concurrent writer is not enabled.

@ulysses-you
Copy link
Contributor Author

@allisonwang-db thank you for review. There are two cases that the ordering does not match:

  • the added sort will be removed in Optimizer, e.g. the plan has one row or the dynamic partition column is foldable
  • the added sort ordering expression has an alias which will be replaced by AliasAwareOutputExpression, then the ordering does not match

I have a pr for case 1 about foldable see #37831, but need to simplify a bit more. I think pr #37525 can save the case 2, although I do not looked it deeply.

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jan 17, 2023
@github-actions github-actions bot closed this Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants