You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/08 08:17:39 UTC
[GitHub] [spark] MaxGekk opened a new pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
MaxGekk opened a new pull request #30667:
URL: https://github.com/apache/spark/pull/30667
### What changes were proposed in this pull request?
1. Check that the partition identifier passed to `SupportsPartitionManagement.partitionExists()` is fully specified (specifies all values of partition fields).
2. Remove the custom implementation of `partitionExists()` from `InMemoryPartitionTable`, and re-use the default implementation from `SupportsPartitionManagement`.
### Why are the changes needed?
The method is supposed to check existence of one partition but currently it can return `true` for partially specified partition. This can lead to incorrect commands behavior, for instance the commands could modify or place data in the middle of partition path.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
By running existing test suites:
```
$ build/sbt "test:testOnly *AlterTablePartitionV2SQLSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *SupportsPartitionManagementSuite"
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538139076
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
Review comment:
What do you propose? The doc says clearly that the method tests existence of **A** partition. Do you want to say that `ident` must contain values for ALL partition fields?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740463850
@cloud-fan @stczwd @rdblue May I ask you to review this PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740495692
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37019/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740542439
**[Test build #132428 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132428/testReport)** for PR 30667 at commit [`4c5cd18`](https://github.com/apache/spark/commit/4c5cd182f7a008cc8363db846e60410e8aead4e3).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740578171
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37029/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538234663
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -76,13 +75,18 @@ void createPartition(
/**
* Test whether a partition exists using an {@link InternalRow ident} from the table.
*
- * @param ident a partition identifier
+ * @param ident a partition identifier which must contain all partition fields in order
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
Review comment:
I hope the indentation of 2 spaces is ok. I see that in other Java classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740564278
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37029/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740695151
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132428/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740517810
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37019/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740604205
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132419/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538159093
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
Review comment:
how about `@param ident a partition identifier which must contain all partition fields in order`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538136623
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
+ if (ident.numFields() == partitionNames.length) {
+ return listPartitionIdentifiers(partitionNames, ident).length > 0;
+ } else {
+ throw new IllegalArgumentException("The number of fields (" + ident.numFields() +
Review comment:
Currently, it shouldn't especially after this PR https://github.com/apache/spark/pull/30624. Maybe I missed some places but as far as I can see, all calls of `partitionExists()` pass fully specified partition ids.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740542439
**[Test build #132428 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132428/testReport)** for PR 30667 at commit [`4c5cd18`](https://github.com/apache/spark/commit/4c5cd182f7a008cc8363db846e60410e8aead4e3).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740471957
**[Test build #132419 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132419/testReport)** for PR 30667 at commit [`1a10ee2`](https://github.com/apache/spark/commit/1a10ee2123398514de695dcfe6edecac19524781).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538134113
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
+ if (ident.numFields() == partitionNames.length) {
+ return listPartitionIdentifiers(partitionNames, ident).length > 0;
+ } else {
+ throw new IllegalArgumentException("The number of fields (" + ident.numFields() +
Review comment:
@MaxGekk so spark will never call this method with partial partition spec?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740471957
**[Test build #132419 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132419/testReport)** for PR 30667 at commit [`1a10ee2`](https://github.com/apache/spark/commit/1a10ee2123398514de695dcfe6edecac19524781).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740682907
**[Test build #132428 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132428/testReport)** for PR 30667 at commit [`4c5cd18`](https://github.com/apache/spark/commit/4c5cd182f7a008cc8363db846e60410e8aead4e3).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538139280
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
+ if (ident.numFields() == partitionNames.length) {
+ return listPartitionIdentifiers(partitionNames, ident).length > 0;
+ } else {
+ throw new IllegalArgumentException("The number of fields (" + ident.numFields() +
Review comment:
OK, then requiring implementations to fail for this case makes sense to me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538140499
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
+ if (ident.numFields() == partitionNames.length) {
+ return listPartitionIdentifiers(partitionNames, ident).length > 0;
+ } else {
+ throw new IllegalArgumentException("The number of fields (" + ident.numFields() +
Review comment:
As an alternative, we could replace the exact check by an assert. Not sure that it is appropriate solution for default API implementation.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538133272
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
Review comment:
can we also update the API doc of this method?
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
Review comment:
can we also update the javadoc of this method?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan closed pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #30667:
URL: https://github.com/apache/spark/pull/30667
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740537326
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37019/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740695151
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132428/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538140499
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -80,9 +79,14 @@ void createPartition(
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
+ if (ident.numFields() == partitionNames.length) {
+ return listPartitionIdentifiers(partitionNames, ident).length > 0;
+ } else {
+ throw new IllegalArgumentException("The number of fields (" + ident.numFields() +
Review comment:
As an alternative, we could replace the exact check by an assert. Not sure that it is the appropriate solution for default API implementation, though ...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740594442
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37029/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538234663
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -76,13 +75,18 @@ void createPartition(
/**
* Test whether a partition exists using an {@link InternalRow ident} from the table.
*
- * @param ident a partition identifier
+ * @param ident a partition identifier which must contain all partition fields in order
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
Review comment:
I hope the indentation of 2 spaces are ok. I see that in other Java classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740603425
**[Test build #132419 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132419/testReport)** for PR 30667 at commit [`1a10ee2`](https://github.com/apache/spark/commit/1a10ee2123398514de695dcfe6edecac19524781).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740463398
We don't need to catch exceptions from `partitionExists()` in ALTER TABLE .. ADD/DROP PARTITION there https://github.com/apache/spark/blob/0a612b6a40696ed8ce00997ebb4e76d05adbbd82/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/AlterTableAddPartitionExec.scala#L40
because the partition spec resolver guaranties fully specified partition id after this PR https://github.com/apache/spark/pull/30624
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740594442
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37029/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740604205
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132419/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-743173874
I'm merging it to master/3.1, as it doesn't change any user-visible behavior. Spark will never call `partitionExists` with partial partition spec, so this PR is more of code cleanup and API doc improvement.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-740537326
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37019/
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #30667:
URL: https://github.com/apache/spark/pull/30667#issuecomment-743021070
Any objections for the changes?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #30667: [SPARK-33706][SQL] Require fully specified partition identifier in partitionExists()
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #30667:
URL: https://github.com/apache/spark/pull/30667#discussion_r538234663
##########
File path: sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsPartitionManagement.java
##########
@@ -76,13 +75,18 @@ void createPartition(
/**
* Test whether a partition exists using an {@link InternalRow ident} from the table.
*
- * @param ident a partition identifier
+ * @param ident a partition identifier which must contain all partition fields in order
* @return true if the partition exists, false otherwise
*/
default boolean partitionExists(InternalRow ident) {
- String[] partitionNames = partitionSchema().names();
- String[] requiredNames = Arrays.copyOfRange(partitionNames, 0, ident.numFields());
- return listPartitionIdentifiers(requiredNames, ident).length > 0;
+ String[] partitionNames = partitionSchema().names();
Review comment:
I hope the indentation of 2 spaces is ok. I see 2 spaces in other Java classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org