JingsongLi commented on code in PR #11226:
URL: https://github.com/apache/paimon/pull/11226#discussion_r4624094564
##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonPartitionManagement.scala:
##########
@@ -233,7 +233,8 @@ trait PaimonPartitionManagement extends
SupportsAtomicPartitionManagement with L
case (partitionName, index) =>
val internalRowIndex =
partitionSchema.fieldIndex(partitionName)
val structField = partitionSchema.fields(internalRowIndex)
- Objects.equals(
+ // `deepEquals`: a BINARY partition value is a `byte[]`.
+ Objects.deepEquals(
Review Comment:
[P1] The new match can delete the NULL partition when the user drops a
non-NULL BINARY partition. I reproduced this on Spark 3.5.9 using a native
table `T (a INT, p BINARY) PARTITIONED BY (p)` with `(1, CAST(' ' AS BINARY)),
(2, NULL), (3, CAST('a' AS BINARY))`. `ALTER TABLE T DROP PARTITION (p = ' ')`
succeeds, then `SELECT a FROM T` returns `1, 3` (expected `2, 3`). `deepEquals`
accepts the one-space bytes in the existence check. The commit then converts
the same identifier through `generatePartValues`, maps whitespace to the
default partition name, and rebuilds a NULL `BinaryRow` for the delete. Please
carry the typed BINARY identifier through the destructive operation, or reject
identifiers that cannot round-trip before committing. Add a regression with
both partitions populated.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]