Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Oct 7, 2022

What changes were proposed in this pull request?

In the PR, I propose to change formatting of partition specs in PartitionsAlreadyExistException. For instance:

spark-sql> ALTER TABLE t ADD PARTITION (id=1) LOCATION 'loc' PARTITION (id=2) LOCATION 'loc1';
The following partitions already exists in table t:2 -> id

After the changes, the error message looks:

The following partitions already exists in table t:id -> 2

Why are the changes needed?

To be consistent w/ V1 catalogs, and to not confuse Spark SQL users.

Does this PR introduce any user-facing change?

Yes, it changes user-facing error message.

How was this patch tested?

By running the modified test suite:

$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"

@github-actions github-actions bot added the SQL label Oct 7, 2022
@MaxGekk MaxGekk changed the title [WIP][SQL] Fix partition specs in PartitionsAlreadyExistException [WIP][SPARK-40702][SQL] Fix partition specs in PartitionsAlreadyExistException Oct 7, 2022
@MaxGekk MaxGekk changed the title [WIP][SPARK-40702][SQL] Fix partition specs in PartitionsAlreadyExistException [SPARK-40702][SQL] Fix partition specs in PartitionsAlreadyExistException Oct 7, 2022
@MaxGekk MaxGekk marked this pull request as ready for review October 7, 2022 14:00
@MaxGekk MaxGekk requested a review from cloud-fan October 7, 2022 14:00
@MaxGekk
Copy link
Member Author

MaxGekk commented Oct 7, 2022

Merging to master. Thank you, @cloud-fan and @singhpk234 for review.

@MaxGekk MaxGekk closed this in 53cc461 Oct 7, 2022
MaxGekk added a commit that referenced this pull request Oct 10, 2022
### What changes were proposed in this pull request?
In the PR, I propose to remove `PartitionAlreadyExistsException` and use `PartitionsAlreadyExistException` instead of it.

### Why are the changes needed?
1. To simplify user apps. After the changes, users don't need to catch both exceptions `PartitionsAlreadyExistException` as well as `PartitionAlreadyExistsException `.
2. To improve code maintenance since don't need to support almost the same code.
3. To avoid errors like the PR #38152 fixed `PartitionsAlreadyExistException` but not `PartitionAlreadyExistsException`.

### Does this PR introduce _any_ user-facing change?
Yes.

### How was this patch tested?
By running the affected test suites:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *SupportsPartitionManagementSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"
```

Closes #38161 from MaxGekk/remove-PartitionAlreadyExistsException.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request Oct 10, 2022
### What changes were proposed in this pull request?
In the PR, I propose to remove `PartitionAlreadyExistsException` and use `PartitionsAlreadyExistException` instead of it.

### Why are the changes needed?
1. To simplify user apps. After the changes, users don't need to catch both exceptions `PartitionsAlreadyExistException` as well as `PartitionAlreadyExistsException `.
2. To improve code maintenance since don't need to support almost the same code.
3. To avoid errors like the PR apache/spark#38152 fixed `PartitionsAlreadyExistException` but not `PartitionAlreadyExistsException`.

### Does this PR introduce _any_ user-facing change?
Yes.

### How was this patch tested?
By running the affected test suites:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *SupportsPartitionManagementSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"
```

Closes #38161 from MaxGekk/remove-PartitionAlreadyExistsException.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request Dec 30, 2022
### What changes were proposed in this pull request?
In the PR, I propose to remove `PartitionAlreadyExistsException` and use `PartitionsAlreadyExistException` instead of it.

### Why are the changes needed?
1. To simplify user apps. After the changes, users don't need to catch both exceptions `PartitionsAlreadyExistException` as well as `PartitionAlreadyExistsException `.
2. To improve code maintenance since don't need to support almost the same code.
3. To avoid errors like the PR apache/spark#38152 fixed `PartitionsAlreadyExistException` but not `PartitionAlreadyExistsException`.

### Does this PR introduce _any_ user-facing change?
Yes.

### How was this patch tested?
By running the affected test suites:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *SupportsPartitionManagementSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"
```

Closes #38161 from MaxGekk/remove-PartitionAlreadyExistsException.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request Dec 30, 2022
### What changes were proposed in this pull request?
In the PR, I propose to remove `PartitionAlreadyExistsException` and use `PartitionsAlreadyExistException` instead of it.

### Why are the changes needed?
1. To simplify user apps. After the changes, users don't need to catch both exceptions `PartitionsAlreadyExistException` as well as `PartitionAlreadyExistsException `.
2. To improve code maintenance since don't need to support almost the same code.
3. To avoid errors like the PR apache/spark#38152 fixed `PartitionsAlreadyExistException` but not `PartitionAlreadyExistsException`.

### Does this PR introduce _any_ user-facing change?
Yes.

### How was this patch tested?
By running the affected test suites:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *SupportsPartitionManagementSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *.AlterTableAddPartitionSuite"
```

Closes #38161 from MaxGekk/remove-PartitionAlreadyExistsException.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants