Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore non-Flint index in show and describe index statement #296

Conversation

dai-chen
Copy link
Collaborator

@dai-chen dai-chen commented Mar 26, 2024

Description

This PR introduced changes in Flint index factory which captured any exception occurred during Flint index creation. The invalid index will be ignored and log a warning message as below. Because all SHOW and DESC statement make use of this factory, this should fix the issue for all show and describe statements.

4/03/26 09:58:40 WARN FlintSparkIndexFactory: Failed to create Flint index from metadata
FlintMetadata(0.3.0,,,,[Ljava.util.Map;@4f60ac31,{},{},{},None,None,
Some({"index.creation_date":"1711472320637","index.number_of_replicas":"1","index.number_of_shards":"1",
"index.provided_name":"flint_spark_catalog_invalid_index","index.uuid":"NUWGIPFjQqO_2hn6pF94_w",
"index.version.created":"136277827"}))
scala.MatchError:  (of class java.lang.String)
	at org.opensearch.flint.spark.FlintSparkIndexFactory$.doCreate(FlintSparkIndexFactory.scala:58)
	at org.opensearch.flint.spark.FlintSparkIndexFactory$.create(FlintSparkIndexFactory.scala:44)
	at org.opensearch.flint.spark.FlintSpark.$anonfun$describeIndexes$2(FlintSpark.scala:181)
	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)

Issues Resolved

#295

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dai-chen dai-chen added bug Something isn't working 0.3 labels Mar 26, 2024
@dai-chen dai-chen self-assigned this Mar 26, 2024
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
@dai-chen dai-chen changed the title Ignore non-Flint index when show or describe index Ignore non-Flint index in show and describe index statement Mar 26, 2024
@dai-chen dai-chen marked this pull request as ready for review March 26, 2024 21:22
@dai-chen dai-chen linked an issue Mar 26, 2024 that may be closed by this pull request
@dai-chen dai-chen merged commit e87d330 into opensearch-project:main Mar 27, 2024
4 checks passed
@dai-chen dai-chen deleted the ignore-non-flint-index-when-show-index branch March 27, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.3 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Show index statement failed if user index name has Flint prefix
3 participants