TheR1sing3un commented on code in PR #14183:
URL: https://github.com/apache/hudi/pull/14183#discussion_r2480099741
##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/SparkFileFormatInternalRowReaderContext.scala:
##########
@@ -262,6 +265,13 @@ object SparkFileFormatInternalRowReaderContext {
metaRefCount == filter.references.length || metaRefCount == 0
}
+ /**
+ * Only valid if the filter's references only include primary key columns or
{@link HoodieRecord.RECORD_KEY_METADATA_FIELD}
+ */
+ def filterIsSafeForPrimaryKey(filter: Filter, recordKeyFields: Set[String]):
Boolean = {
+ filter.references.forall(c => recordKeyFields.contains(c.toLowerCase) ||
c.equalsIgnoreCase(HoodieRecord.RECORD_KEY_METADATA_FIELD))
Review Comment:
> seems not right, all the record key fields should be included.
Do you mean in the case of composite primary keys? It is not necessary for
all the composite primary keys to exist in the filter, because when we perform
the merge, if the composite primary keys of the duplicate data used for
comparison are equal, then each key in the composite primary key must also be
equal.
--
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]