codope commented on code in PR #12919:
URL: https://github.com/apache/hudi/pull/12919#discussion_r1987184769
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/feature/index/TestExpressionIndex.scala:
##########
@@ -1776,7 +1776,16 @@ class TestExpressionIndex extends HoodieSparkSqlTestBase
{
|""".stripMargin)
// create index using bloom filters on city column with upper()
function
- spark.sql(s"create index idx_bloom_$tableName on $tableName using
bloom_filters(city) options(expr='upper')")
+ spark.sql(s"create index idx_bloom_$tableName on $tableName using
bloom_filters(city) options(expr='upper', fpp='0.01', filterType='SIMPLE',
numEntries='1000')")
+ var metaClient = createMetaClient(spark, basePath)
+
assertTrue(metaClient.getTableConfig.getMetadataPartitions.contains(s"expr_index_idx_bloom_$tableName"))
+ assertTrue(metaClient.getIndexMetadata.isPresent)
+ assertEquals(2,
metaClient.getIndexMetadata.get.getIndexDefinitions.size())
+ val indexDefinition: HoodieIndexDefinition =
metaClient.getIndexMetadata.get.getIndexDefinitions.get(s"expr_index_idx_bloom_$tableName")
+ // validate index options
+ assertEquals("0.01", indexDefinition.getIndexOptions.get("fpp"))
+ assertEquals("SIMPLE",
indexDefinition.getIndexOptions.get("filterType"))
+ assertEquals("1000", indexDefinition.getIndexOptions.get("numEntries"))
Review Comment:
among these options, we are only saving the bloom filter type in bloom
filter metadata.. Added a validation in both the tests on the type (one test
validates SIMPLE and the other DYNAMIC_V0). Since the type is getting
propagated, every other option should also get propagated properly. Also, there
is validaiton on the index definition that we save.
--
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]