lokeshj1703 commented on code in PR #9760:
URL: https://github.com/apache/hudi/pull/9760#discussion_r1334127077
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestMergeIntoTable.scala:
##########
@@ -1236,4 +1238,98 @@ class TestMergeIntoTable extends HoodieSparkSqlTestBase
with ScalaAssertionSuppo
})
}
}
+
+ test("Test MergeInto With Record Index and Data Skipping") {
+ Seq(true, false).foreach { sparkSqlOptimizedWrites =>
+ withRecordType()(withTempDir { tmp =>
+ spark.sql("set hoodie.payload.combined.schema.validate = false")
+ val tableName = generateTableName
+
+ val cls = classOf[HoodieFileIndex]
+ val appender = LoggingTestUtils.attachInMemoryAppender(cls)
+ var msg = "Total file slices: 1; candidate file slices after data
skipping: 0; skipping percentage 1.0"
+
+ // Create table
+ spark.sql(
+ s"""
+ |create table $tableName (
+ | id int,
+ | name string,
+ | price double,
+ | ts long
+ |) using hudi
+ | location '${tmp.getCanonicalPath}'
+ | tblproperties (
+ | primaryKey ='id',
+ | preCombineField = 'ts',
+ | 'hoodie.metadata.enable' = 'true',
+ | 'hoodie.metadata.record.index.enable' = 'true',
+ | 'hoodie.enable.data.skipping' = 'true'
+ | )
+ """.stripMargin)
+
+ // test with optimized sql merge enabled / disabled.
+ spark.sql(s"set
${SPARK_SQL_OPTIMIZED_WRITES.key()}=$sparkSqlOptimizedWrites")
+ spark.sql("set hoodie.metadata.enable = true")
+ spark.sql("set hoodie.metadata.record.index.enable = true")
+ spark.sql("set hoodie.enable.data.skipping = true")
+ spark.sql("set hoodie.parquet.small.file.limit = 0")
Review Comment:
Yes, only for creating two file slices.
--
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]