apache / hudi

Upserts, Deletes And Incremental Processing on Big Data.
https://hudi.apache.org/
Apache License 2.0
5.46k stars 2.43k forks source link

[HUDI-8520] DROP INDEX & SHOW INDEX should work with index name instead of index partition name #12266

Closed lokeshj1703 closed 4 days ago

lokeshj1703 commented 1 week ago

Change Logs

spark-sql (default)> drop index idx_rider on hudi_table;
24/11/13 16:14:25 ERROR SparkSQLDriver: Failed in [drop index idx_rider on hudi_table]
org.apache.hudi.exception.HoodieSecondaryIndexException: Secondary index not exists: idx_rider
    at org.apache.hudi.index.secondary.SecondaryIndexManager.drop(SecondaryIndexManager.java:145)
    at org.apache.spark.sql.hudi.command.DropIndexCommand.run(IndexCommands.scala:83)
    at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:75)

Drop index is not working using index name currently. It requires full name with prefix in order to drop the index. This PR aims to fix it so that index can be dropped using the index name itself. Also the PR adds a fix so that show index works for both secondary and functional index.

Impact

NA

Risk level (write none, low medium or high below)

low

Documentation Update

NA

Contributor's checklist

lokeshj1703 commented 1 week ago

@vinothchandar I have restored the old secondary index files. Could not think of a good package to move them to. These are the only files in location hudi-common/src/main/java/org/apache/hudi/index/secondary though.

hudi-bot commented 4 days ago

CI report:

Bot commands @hudi-bot supports the following commands: - `@hudi-bot run azure` re-run the last Azure build
codope commented 4 days ago

The failing test Test Secondary Index With Updates Compaction Clustering Deletes is flaky on master. It is tracked in HUDI-8549. Going to merge this PR.