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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]