codope commented on code in PR #11162:
URL: https://github.com/apache/hudi/pull/11162#discussion_r1628190224


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSecondaryIndexWithSql.scala:
##########
@@ -95,4 +97,39 @@ class TestSecondaryIndexWithSql extends 
SecondaryIndexTestBase {
   private def checkAnswer(sql: String)(expects: Seq[Any]*): Unit = {
     assertResult(expects.map(row => Row(row: 
_*)).toArray.sortBy(_.toString()))(spark.sql(sql).collect().sortBy(_.toString()))
   }
+
+  @Test
+  def testSecondaryIndexWithInFilter(): Unit = {
+    if (HoodieSparkUtils.gteqSpark3_2) {
+      var hudiOpts = commonOpts
+      hudiOpts = hudiOpts + (
+        DataSourceWriteOptions.TABLE_TYPE.key -> 
HoodieTableType.COPY_ON_WRITE.name(),
+        DataSourceReadOptions.ENABLE_DATA_SKIPPING.key -> "true")
+
+      spark.sql(
+        s"""
+           |create table $tableName (
+           |  record_key_col string,
+           |  not_record_key_col string,
+           |  partition_key_col string
+           |) using hudi
+           | options (
+           |  primaryKey ='record_key_col',
+           |  hoodie.metadata.enable = 'true',
+           |  hoodie.metadata.record.index.enable = 'true',
+           |  hoodie.datasource.write.recordkey.field = 'record_key_col',
+           |  hoodie.enable.data.skipping = 'true'
+           | )
+           | partitioned by(partition_key_col)
+           | location '$basePath'
+       """.stripMargin)
+      spark.sql(s"insert into $tableName values('row1', 'abc', 'p1')")

Review Comment:
   Fixed the issue in the latest commit.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to