yihua commented on code in PR #11678:
URL: https://github.com/apache/hudi/pull/11678#discussion_r1690614389
##########
hudi-spark-datasource/hudi-spark-common/src/test/scala/org/apache/hudi/TestRecordLevelIndexSupport.scala:
##########
@@ -49,7 +49,7 @@ class TestRecordLevelIndexSupport {
// Case 4: EqualTo filters on simple AttributeReference and Literal which
should return non-empty result
testFilter = EqualTo(AttributeReference("_row_key", StringType, nullable =
true)(), Literal("row1"))
- result = RecordLevelIndexSupport.filterQueryWithRecordKey(testFilter,
Option.apply(HoodieMetadataField.RECORD_KEY_METADATA_FIELD.getFieldName))
+ result = RecordLevelIndexSupport.filterQueryWithRecordKey(testFilter,
Option.apply("_row_key"))
Review Comment:
Can we test both record key field and `RECORD_KEY_METADATA_FIELD` with
`RecordLevelIndexSupport.filterQueryWithRecordKey` for all test cases, by
parameterizing this test method (including the cases that return empty result)?
##########
hudi-spark-datasource/hudi-spark-common/src/test/scala/org/apache/hudi/TestRecordLevelIndexSupport.scala:
##########
@@ -64,7 +64,7 @@ class TestRecordLevelIndexSupport {
// Case 7: In filter on record key should return non-empty result
testFilter = In(AttributeReference("_row_key", StringType, nullable =
true)(), List.apply(Literal("xyz"), Literal("abc")))
- result = RecordLevelIndexSupport.filterQueryWithRecordKey(testFilter,
Option.apply(HoodieMetadataField.RECORD_KEY_METADATA_FIELD.getFieldName))
+ result = RecordLevelIndexSupport.filterQueryWithRecordKey(testFilter,
Option.apply("_row_key"))
Review Comment:
Validate the `result` beyond `assertTrue(result.isDefined)`?
--
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]